OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" | 5 #import "ios/chrome/browser/ui/toolbar/web_toolbar_controller.h" |
6 | 6 |
7 #import <CoreLocation/CoreLocation.h> | 7 #import <CoreLocation/CoreLocation.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 } | 477 } |
478 } | 478 } |
479 | 479 |
480 [_webToolbar addSubview:_omniBox]; | 480 [_webToolbar addSubview:_omniBox]; |
481 | 481 |
482 [_backButton setEnabled:NO]; | 482 [_backButton setEnabled:NO]; |
483 [_forwardButton setEnabled:NO]; | 483 [_forwardButton setEnabled:NO]; |
484 | 484 |
485 // Assign tags before calling -setUpButton, since only buttons with tags | 485 // Assign tags before calling -setUpButton, since only buttons with tags |
486 // have -chromeExecuteCommand added as a target. | 486 // have -chromeExecuteCommand added as a target. |
487 [_starButton setTag:IDC_BOOKMARK_PAGE]; | |
488 [_voiceSearchButton setTag:IDC_VOICE_SEARCH]; | 487 [_voiceSearchButton setTag:IDC_VOICE_SEARCH]; |
489 | 488 |
490 if (idiom == IPAD_IDIOM) { | 489 if (idiom == IPAD_IDIOM) { |
491 // Note that the reload button gets repositioned when -layoutOmnibox is | 490 // Note that the reload button gets repositioned when -layoutOmnibox is |
492 // called. | 491 // called. |
493 _reloadButton = [[UIButton alloc] | 492 _reloadButton = [[UIButton alloc] |
494 initWithFrame:LayoutRectGetRect(kStopReloadButtonFrame)]; | 493 initWithFrame:LayoutRectGetRect(kStopReloadButtonFrame)]; |
495 [_reloadButton | 494 [_reloadButton |
496 setAutoresizingMask:UIViewAutoresizingFlexibleTrailingMargin() | | 495 setAutoresizingMask:UIViewAutoresizingFlexibleTrailingMargin() | |
497 UIViewAutoresizingFlexibleBottomMargin]; | 496 UIViewAutoresizingFlexibleBottomMargin]; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 synchronously:NO]; | 534 synchronously:NO]; |
536 [_stopButton setHidden:YES]; | 535 [_stopButton setHidden:YES]; |
537 | 536 |
538 // Assign targets for buttons using the dispatcher. | 537 // Assign targets for buttons using the dispatcher. |
539 [_stopButton addTarget:self.dispatcher | 538 [_stopButton addTarget:self.dispatcher |
540 action:@selector(stopLoading) | 539 action:@selector(stopLoading) |
541 forControlEvents:UIControlEventTouchUpInside]; | 540 forControlEvents:UIControlEventTouchUpInside]; |
542 [_reloadButton addTarget:self.dispatcher | 541 [_reloadButton addTarget:self.dispatcher |
543 action:@selector(reload) | 542 action:@selector(reload) |
544 forControlEvents:UIControlEventTouchUpInside]; | 543 forControlEvents:UIControlEventTouchUpInside]; |
| 544 [_starButton addTarget:self.dispatcher |
| 545 action:@selector(bookmarkPage) |
| 546 forControlEvents:UIControlEventTouchUpInside]; |
545 } else { | 547 } else { |
546 [_forwardButton setAlpha:0.0]; | 548 [_forwardButton setAlpha:0.0]; |
547 } | 549 } |
548 | 550 |
549 // Set up the button images and omnibox background. | 551 // Set up the button images and omnibox background. |
550 [self setUpButton:_backButton | 552 [self setUpButton:_backButton |
551 withImageEnum:WebToolbarButtonNameBack | 553 withImageEnum:WebToolbarButtonNameBack |
552 forInitialState:UIControlStateDisabled | 554 forInitialState:UIControlStateDisabled |
553 hasDisabledImage:YES | 555 hasDisabledImage:YES |
554 synchronously:NO]; | 556 synchronously:NO]; |
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 | 2498 |
2497 - (BOOL)isPrerenderAnimationRunning { | 2499 - (BOOL)isPrerenderAnimationRunning { |
2498 return _prerenderAnimating; | 2500 return _prerenderAnimating; |
2499 } | 2501 } |
2500 | 2502 |
2501 - (OmniboxTextFieldIOS*)omnibox { | 2503 - (OmniboxTextFieldIOS*)omnibox { |
2502 return _omniBox; | 2504 return _omniBox; |
2503 } | 2505 } |
2504 | 2506 |
2505 @end | 2507 @end |
OLD | NEW |