| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/app/chrome_command_ids.h" | 12 #include "chrome/app/chrome_command_ids.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/command_updater.h" | 14 #include "chrome/browser/command_updater.h" |
| 15 #include "chrome/browser/extensions/extension_action.h" | 15 #include "chrome/browser/extensions/extension_action.h" |
| 16 #include "chrome/browser/extensions/extension_action_manager.h" | 16 #include "chrome/browser/extensions/extension_action_manager.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/search/search.h" | |
| 19 #include "chrome/browser/themes/theme_service.h" | 18 #include "chrome/browser/themes/theme_service.h" |
| 20 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/browser_command_controller.h" | 20 #include "chrome/browser/ui/browser_command_controller.h" |
| 22 #include "chrome/browser/ui/browser_commands.h" | 21 #include "chrome/browser/ui/browser_commands.h" |
| 23 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 22 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| 24 #include "chrome/browser/ui/browser_instant_controller.h" | 23 #include "chrome/browser/ui/browser_instant_controller.h" |
| 25 #include "chrome/browser/ui/browser_tabstrip.h" | 24 #include "chrome/browser/ui/browser_tabstrip.h" |
| 26 #include "chrome/browser/ui/browser_window.h" | 25 #include "chrome/browser/ui/browser_window.h" |
| 27 #include "chrome/browser/ui/global_error/global_error_service.h" | 26 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 28 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 27 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 29 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 28 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 29 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 31 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 30 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
| 32 #include "chrome/browser/ui/view_ids.h" | 31 #include "chrome/browser/ui/view_ids.h" |
| 33 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" | 32 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" |
| 34 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 33 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 35 #include "chrome/browser/ui/views/frame/browser_view.h" | 34 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 36 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" | 35 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
| 37 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" | 36 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" |
| 38 #include "chrome/browser/ui/views/location_bar/star_view.h" | 37 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 39 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" | 38 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" |
| 40 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" | 39 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" |
| 41 #include "chrome/browser/ui/views/toolbar/back_button.h" | 40 #include "chrome/browser/ui/views/toolbar/back_button.h" |
| 42 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 41 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 43 #include "chrome/browser/ui/views/toolbar/home_button.h" | 42 #include "chrome/browser/ui/views/toolbar/home_button.h" |
| 44 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 43 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
| 45 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" | 44 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" |
| 46 #include "chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.h" | |
| 47 #include "chrome/browser/ui/views/toolbar/wrench_menu.h" | 45 #include "chrome/browser/ui/views/toolbar/wrench_menu.h" |
| 48 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h" | 46 #include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h" |
| 49 #include "chrome/browser/upgrade_detector.h" | 47 #include "chrome/browser/upgrade_detector.h" |
| 50 #include "chrome/common/chrome_switches.h" | 48 #include "chrome/common/chrome_switches.h" |
| 51 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 52 #include "content/public/browser/browser_accessibility_state.h" | 50 #include "content/public/browser/browser_accessibility_state.h" |
| 53 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
| 54 #include "content/public/browser/render_view_host.h" | 52 #include "content/public/browser/render_view_host.h" |
| 55 #include "content/public/browser/user_metrics.h" | 53 #include "content/public/browser/user_metrics.h" |
| 56 #include "content/public/browser/web_contents.h" | 54 #include "content/public/browser/web_contents.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 125 |
| 128 //////////////////////////////////////////////////////////////////////////////// | 126 //////////////////////////////////////////////////////////////////////////////// |
| 129 // ToolbarView, public: | 127 // ToolbarView, public: |
| 130 | 128 |
| 131 ToolbarView::ToolbarView(Browser* browser) | 129 ToolbarView::ToolbarView(Browser* browser) |
| 132 : back_(NULL), | 130 : back_(NULL), |
| 133 forward_(NULL), | 131 forward_(NULL), |
| 134 reload_(NULL), | 132 reload_(NULL), |
| 135 home_(NULL), | 133 home_(NULL), |
| 136 location_bar_(NULL), | 134 location_bar_(NULL), |
| 137 origin_chip_view_(NULL), | |
| 138 browser_actions_(NULL), | 135 browser_actions_(NULL), |
| 139 app_menu_(NULL), | 136 app_menu_(NULL), |
| 140 browser_(browser), | 137 browser_(browser), |
| 141 extension_message_bubble_factory_( | 138 extension_message_bubble_factory_( |
| 142 new extensions::ExtensionMessageBubbleFactory(browser->profile(), | 139 new extensions::ExtensionMessageBubbleFactory(browser->profile(), |
| 143 this)) { | 140 this)) { |
| 144 set_id(VIEW_ID_TOOLBAR); | 141 set_id(VIEW_ID_TOOLBAR); |
| 145 | 142 |
| 146 chrome::AddCommandObserver(browser_, IDC_BACK, this); | 143 chrome::AddCommandObserver(browser_, IDC_BACK, this); |
| 147 chrome::AddCommandObserver(browser_, IDC_FORWARD, this); | 144 chrome::AddCommandObserver(browser_, IDC_FORWARD, this); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 browser_actions_ = new BrowserActionsContainer(browser_, this); | 228 browser_actions_ = new BrowserActionsContainer(browser_, this); |
| 232 | 229 |
| 233 app_menu_ = new WrenchToolbarButton(this); | 230 app_menu_ = new WrenchToolbarButton(this); |
| 234 app_menu_->SetBorder(views::Border::NullBorder()); | 231 app_menu_->SetBorder(views::Border::NullBorder()); |
| 235 app_menu_->EnableCanvasFlippingForRTLUI(true); | 232 app_menu_->EnableCanvasFlippingForRTLUI(true); |
| 236 app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)); | 233 app_menu_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_APP)); |
| 237 app_menu_->SetTooltipText(l10n_util::GetStringUTF16(IDS_APPMENU_TOOLTIP)); | 234 app_menu_->SetTooltipText(l10n_util::GetStringUTF16(IDS_APPMENU_TOOLTIP)); |
| 238 app_menu_->set_id(VIEW_ID_APP_MENU); | 235 app_menu_->set_id(VIEW_ID_APP_MENU); |
| 239 | 236 |
| 240 // Always add children in order from left to right, for accessibility. | 237 // Always add children in order from left to right, for accessibility. |
| 241 origin_chip_view_ = new ToolbarOriginChipView(this); | |
| 242 chrome::OriginChipPosition origin_chip_position = | |
| 243 chrome::GetOriginChipPosition(); | |
| 244 AddChildView(back_); | 238 AddChildView(back_); |
| 245 AddChildView(forward_); | 239 AddChildView(forward_); |
| 246 AddChildView(reload_); | 240 AddChildView(reload_); |
| 247 AddChildView(home_); | 241 AddChildView(home_); |
| 248 if (origin_chip_position == chrome::ORIGIN_CHIP_LEADING_LOCATION_BAR) | |
| 249 AddChildView(origin_chip_view_); | |
| 250 AddChildView(location_bar_); | 242 AddChildView(location_bar_); |
| 251 if (origin_chip_position == chrome::ORIGIN_CHIP_TRAILING_LOCATION_BAR) | |
| 252 AddChildView(origin_chip_view_); | |
| 253 AddChildView(browser_actions_); | 243 AddChildView(browser_actions_); |
| 254 if (origin_chip_position == chrome::ORIGIN_CHIP_LEADING_MENU_BUTTON || | |
| 255 origin_chip_position == chrome::ORIGIN_CHIP_DISABLED) | |
| 256 AddChildView(origin_chip_view_); | |
| 257 AddChildView(app_menu_); | 244 AddChildView(app_menu_); |
| 258 | 245 |
| 259 LoadImages(); | 246 LoadImages(); |
| 260 | 247 |
| 261 // Start global error services now so we badge the menu correctly in non-Ash. | 248 // Start global error services now so we badge the menu correctly in non-Ash. |
| 262 #if !defined(OS_CHROMEOS) | 249 #if !defined(OS_CHROMEOS) |
| 263 if (!HasAshShell()) { | 250 if (!HasAshShell()) { |
| 264 SigninGlobalErrorFactory::GetForProfile(browser_->profile()); | 251 SigninGlobalErrorFactory::GetForProfile(browser_->profile()); |
| 265 #if !defined(OS_ANDROID) | 252 #if !defined(OS_ANDROID) |
| 266 SyncGlobalErrorFactory::GetForProfile(browser_->profile()); | 253 SyncGlobalErrorFactory::GetForProfile(browser_->profile()); |
| 267 #endif | 254 #endif |
| 268 } | 255 } |
| 269 #endif // OS_CHROMEOS | 256 #endif // OS_CHROMEOS |
| 270 | 257 |
| 271 // Add any necessary badges to the menu item based on the system state. | 258 // Add any necessary badges to the menu item based on the system state. |
| 272 // Do this after |app_menu_| has been added as a bubble may be shown that | 259 // Do this after |app_menu_| has been added as a bubble may be shown that |
| 273 // needs the widget (widget found by way of app_menu_->GetWidget()). | 260 // needs the widget (widget found by way of app_menu_->GetWidget()). |
| 274 UpdateAppMenuState(); | 261 UpdateAppMenuState(); |
| 275 | 262 |
| 276 location_bar_->Init(); | 263 location_bar_->Init(); |
| 277 | 264 |
| 278 origin_chip_view_->Init(); | |
| 279 if (origin_chip_view_->ShouldShow()) | |
| 280 location_bar_->set_toolbar_origin_chip_view(origin_chip_view_); | |
| 281 | |
| 282 show_home_button_.Init(prefs::kShowHomeButton, | 265 show_home_button_.Init(prefs::kShowHomeButton, |
| 283 browser_->profile()->GetPrefs(), | 266 browser_->profile()->GetPrefs(), |
| 284 base::Bind(&ToolbarView::OnShowHomeButtonChanged, | 267 base::Bind(&ToolbarView::OnShowHomeButtonChanged, |
| 285 base::Unretained(this))); | 268 base::Unretained(this))); |
| 286 | 269 |
| 287 browser_actions_->Init(); | 270 browser_actions_->Init(); |
| 288 | 271 |
| 289 // Accessibility specific tooltip text. | 272 // Accessibility specific tooltip text. |
| 290 if (content::BrowserAccessibilityState::GetInstance()-> | 273 if (content::BrowserAccessibilityState::GetInstance()-> |
| 291 IsAccessibleBrowser()) { | 274 IsAccessibleBrowser()) { |
| 292 back_->SetTooltipText( | 275 back_->SetTooltipText( |
| 293 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); | 276 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); |
| 294 forward_->SetTooltipText( | 277 forward_->SetTooltipText( |
| 295 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); | 278 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); |
| 296 } | 279 } |
| 297 } | 280 } |
| 298 | 281 |
| 299 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, | 282 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, |
| 300 bool visible) { | 283 bool visible) { |
| 301 // Safe to call multiple times; the bubble will only appear once. | 284 // Safe to call multiple times; the bubble will only appear once. |
| 302 if (visible) | 285 if (visible) |
| 303 extension_message_bubble_factory_->MaybeShow(app_menu_); | 286 extension_message_bubble_factory_->MaybeShow(app_menu_); |
| 304 } | 287 } |
| 305 | 288 |
| 306 void ToolbarView::Update(WebContents* tab) { | 289 void ToolbarView::Update(WebContents* tab) { |
| 307 if (location_bar_) | 290 if (location_bar_) |
| 308 location_bar_->Update(tab); | 291 location_bar_->Update(tab); |
| 309 if (origin_chip_view_->visible()) | |
| 310 origin_chip_view_->Update(tab); | |
| 311 | |
| 312 if (browser_actions_) | 292 if (browser_actions_) |
| 313 browser_actions_->RefreshBrowserActionViews(); | 293 browser_actions_->RefreshBrowserActionViews(); |
| 314 | |
| 315 if (reload_) | 294 if (reload_) |
| 316 reload_->set_menu_enabled(chrome::IsDebuggerAttachedToCurrentTab(browser_)); | 295 reload_->set_menu_enabled(chrome::IsDebuggerAttachedToCurrentTab(browser_)); |
| 317 } | 296 } |
| 318 | 297 |
| 319 void ToolbarView::SetPaneFocusAndFocusAppMenu() { | 298 void ToolbarView::SetPaneFocusAndFocusAppMenu() { |
| 320 SetPaneFocus(app_menu_); | 299 SetPaneFocus(app_menu_); |
| 321 } | 300 } |
| 322 | 301 |
| 323 bool ToolbarView::IsAppMenuFocused() { | 302 bool ToolbarView::IsAppMenuFocused() { |
| 324 return app_menu_->HasFocus(); | 303 return app_menu_->HasFocus(); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 | 519 |
| 541 gfx::Size ToolbarView::GetPreferredSize() { | 520 gfx::Size ToolbarView::GetPreferredSize() { |
| 542 gfx::Size size(location_bar_->GetPreferredSize()); | 521 gfx::Size size(location_bar_->GetPreferredSize()); |
| 543 if (is_display_mode_normal()) { | 522 if (is_display_mode_normal()) { |
| 544 size.Enlarge( | 523 size.Enlarge( |
| 545 kLeftEdgeSpacing + back_->GetPreferredSize().width() + | 524 kLeftEdgeSpacing + back_->GetPreferredSize().width() + |
| 546 forward_->GetPreferredSize().width() + | 525 forward_->GetPreferredSize().width() + |
| 547 reload_->GetPreferredSize().width() + kStandardSpacing + | 526 reload_->GetPreferredSize().width() + kStandardSpacing + |
| 548 (show_home_button_.GetValue() ? | 527 (show_home_button_.GetValue() ? |
| 549 home_->GetPreferredSize().width() : 0) + | 528 home_->GetPreferredSize().width() : 0) + |
| 550 (origin_chip_view_->visible() ? | |
| 551 (origin_chip_view_->GetPreferredSize().width() + | |
| 552 2 * kStandardSpacing) : | |
| 553 0) + | |
| 554 browser_actions_->GetPreferredSize().width() + | 529 browser_actions_->GetPreferredSize().width() + |
| 555 app_menu_->GetPreferredSize().width() + kRightEdgeSpacing, | 530 app_menu_->GetPreferredSize().width() + kRightEdgeSpacing, |
| 556 0); | 531 0); |
| 557 gfx::ImageSkia* normal_background = | 532 gfx::ImageSkia* normal_background = |
| 558 GetThemeProvider()->GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER); | 533 GetThemeProvider()->GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER); |
| 559 size.SetToMax( | 534 size.SetToMax( |
| 560 gfx::Size(0, normal_background->height() - content_shadow_height())); | 535 gfx::Size(0, normal_background->height() - content_shadow_height())); |
| 561 } else { | 536 } else { |
| 562 const int kPopupBottomSpacingGlass = 1; | 537 const int kPopupBottomSpacingGlass = 1; |
| 563 const int kPopupBottomSpacingNonGlass = 2; | 538 const int kPopupBottomSpacingNonGlass = 2; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 home_->SetVisible(false); | 597 home_->SetVisible(false); |
| 623 home_->SetBounds(next_element_x, child_y, 0, child_height); | 598 home_->SetBounds(next_element_x, child_y, 0, child_height); |
| 624 } | 599 } |
| 625 next_element_x = home_->bounds().right() + kStandardSpacing; | 600 next_element_x = home_->bounds().right() + kStandardSpacing; |
| 626 | 601 |
| 627 int browser_actions_width = browser_actions_->GetPreferredSize().width(); | 602 int browser_actions_width = browser_actions_->GetPreferredSize().width(); |
| 628 int app_menu_width = app_menu_->GetPreferredSize().width(); | 603 int app_menu_width = app_menu_->GetPreferredSize().width(); |
| 629 int available_width = std::max(0, width() - kRightEdgeSpacing - | 604 int available_width = std::max(0, width() - kRightEdgeSpacing - |
| 630 app_menu_width - browser_actions_width - next_element_x); | 605 app_menu_width - browser_actions_width - next_element_x); |
| 631 | 606 |
| 632 origin_chip_view_->SetVisible(origin_chip_view_->ShouldShow()); | |
| 633 int origin_chip_width = | |
| 634 origin_chip_view_->ElideDomainTarget(available_width / 2); | |
| 635 if (origin_chip_view_->visible()) | |
| 636 available_width -= origin_chip_width + kStandardSpacing; | |
| 637 | |
| 638 chrome::OriginChipPosition origin_chip_position = | |
| 639 chrome::GetOriginChipPosition(); | |
| 640 if (origin_chip_view_->visible() && | |
| 641 origin_chip_position == chrome::ORIGIN_CHIP_LEADING_LOCATION_BAR) { | |
| 642 origin_chip_view_->SetBounds(next_element_x, child_y, | |
| 643 origin_chip_width, child_height); | |
| 644 next_element_x = origin_chip_view_->bounds().right() + kStandardSpacing; | |
| 645 } | |
| 646 | |
| 647 int location_height = location_bar_->GetPreferredSize().height(); | 607 int location_height = location_bar_->GetPreferredSize().height(); |
| 648 int location_y = (height() - location_height + 1) / 2; | 608 int location_y = (height() - location_height + 1) / 2; |
| 649 location_bar_->SetBounds(next_element_x, location_y, | 609 location_bar_->SetBounds(next_element_x, location_y, |
| 650 std::max(available_width, 0), location_height); | 610 std::max(available_width, 0), location_height); |
| 651 next_element_x = location_bar_->bounds().right(); | 611 next_element_x = location_bar_->bounds().right(); |
| 652 | 612 |
| 653 if (origin_chip_view_->visible() && | |
| 654 origin_chip_position == chrome::ORIGIN_CHIP_TRAILING_LOCATION_BAR) { | |
| 655 origin_chip_view_->SetBounds(next_element_x + kStandardSpacing, child_y, | |
| 656 origin_chip_width, child_height); | |
| 657 next_element_x = origin_chip_view_->bounds().right(); | |
| 658 } | |
| 659 | |
| 660 browser_actions_->SetBounds( | 613 browser_actions_->SetBounds( |
| 661 next_element_x, child_y, browser_actions_width, child_height); | 614 next_element_x, child_y, browser_actions_width, child_height); |
| 662 next_element_x = browser_actions_->bounds().right(); | 615 next_element_x = browser_actions_->bounds().right(); |
| 663 | 616 |
| 664 // The browser actions need to do a layout explicitly, because when an | 617 // The browser actions need to do a layout explicitly, because when an |
| 665 // extension is loaded/unloaded/changed, BrowserActionContainer removes and | 618 // extension is loaded/unloaded/changed, BrowserActionContainer removes and |
| 666 // re-adds everything, regardless of whether it has a page action. For a | 619 // re-adds everything, regardless of whether it has a page action. For a |
| 667 // page action, browser action bounds do not change, as a result of which | 620 // page action, browser action bounds do not change, as a result of which |
| 668 // SetBounds does not do a layout at all. | 621 // SetBounds does not do a layout at all. |
| 669 // TODO(sidchat): Rework the above behavior so that explicit layout is not | 622 // TODO(sidchat): Rework the above behavior so that explicit layout is not |
| 670 // required. | 623 // required. |
| 671 browser_actions_->Layout(); | 624 browser_actions_->Layout(); |
| 672 | 625 |
| 673 if (origin_chip_view_->visible() && | |
| 674 origin_chip_position == chrome::ORIGIN_CHIP_LEADING_MENU_BUTTON) { | |
| 675 origin_chip_view_->SetBounds(next_element_x, child_y, | |
| 676 origin_chip_width, child_height); | |
| 677 next_element_x = origin_chip_view_->bounds().right() + kStandardSpacing; | |
| 678 } | |
| 679 | |
| 680 // Extend the app menu to the screen's right edge in maximized mode just like | 626 // Extend the app menu to the screen's right edge in maximized mode just like |
| 681 // we extend the back button to the left edge. | 627 // we extend the back button to the left edge. |
| 682 if (maximized) | 628 if (maximized) |
| 683 app_menu_width += kRightEdgeSpacing; | 629 app_menu_width += kRightEdgeSpacing; |
| 684 app_menu_->SetBounds(next_element_x, child_y, app_menu_width, child_height); | 630 app_menu_->SetBounds(next_element_x, child_y, app_menu_width, child_height); |
| 685 } | 631 } |
| 686 | 632 |
| 687 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { | 633 bool ToolbarView::HitTestRect(const gfx::Rect& rect) const { |
| 688 // Fall through to the tab strip above us if none of |rect| intersects | 634 // Fall through to the tab strip above us if none of |rect| intersects |
| 689 // with this view (intersection with the top shadow edge does not | 635 // with this view (intersection with the top shadow edge does not |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 | 823 |
| 878 void ToolbarView::OnShowHomeButtonChanged() { | 824 void ToolbarView::OnShowHomeButtonChanged() { |
| 879 Layout(); | 825 Layout(); |
| 880 SchedulePaint(); | 826 SchedulePaint(); |
| 881 } | 827 } |
| 882 | 828 |
| 883 int ToolbarView::content_shadow_height() const { | 829 int ToolbarView::content_shadow_height() const { |
| 884 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 830 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 885 kContentShadowHeightAsh : kContentShadowHeight; | 831 kContentShadowHeightAsh : kContentShadowHeight; |
| 886 } | 832 } |
| OLD | NEW |