| 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/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/themes/theme_service.h" | 16 #include "chrome/browser/themes/theme_service.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_command_controller.h" | 18 #include "chrome/browser/ui/browser_command_controller.h" |
| 19 #include "chrome/browser/ui/browser_commands.h" | 19 #include "chrome/browser/ui/browser_commands.h" |
| 20 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 20 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| 21 #include "chrome/browser/ui/browser_instant_controller.h" | 21 #include "chrome/browser/ui/browser_instant_controller.h" |
| 22 #include "chrome/browser/ui/browser_tabstrip.h" | 22 #include "chrome/browser/ui/browser_tabstrip.h" |
| 23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
| 24 #include "chrome/browser/ui/global_error/global_error_service.h" | 24 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 25 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 25 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 26 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 26 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 27 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 28 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 28 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
| 29 #include "chrome/browser/ui/view_ids.h" | 29 #include "chrome/browser/ui/view_ids.h" |
| 30 #include "chrome/browser/ui/views/extensions/suspicious_extension_bubble_view.h" | 30 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" |
| 31 #include "chrome/browser/ui/views/frame/browser_view.h" | 31 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 32 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" | 32 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
| 33 #include "chrome/browser/ui/views/location_bar/star_view.h" | 33 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 34 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" | 34 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" |
| 35 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" | 35 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" |
| 36 #include "chrome/browser/ui/views/toolbar/back_button.h" | 36 #include "chrome/browser/ui/views/toolbar/back_button.h" |
| 37 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 37 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 38 #include "chrome/browser/ui/views/toolbar/home_button.h" | 38 #include "chrome/browser/ui/views/toolbar/home_button.h" |
| 39 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 39 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
| 40 #include "chrome/browser/ui/views/toolbar/site_chip_view.h" | 40 #include "chrome/browser/ui/views/toolbar/site_chip_view.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 back_->SetTooltipText( | 260 back_->SetTooltipText( |
| 261 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); | 261 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); |
| 262 forward_->SetTooltipText( | 262 forward_->SetTooltipText( |
| 263 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); | 263 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, | 267 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, |
| 268 bool visible) { | 268 bool visible) { |
| 269 if (visible) { | 269 if (visible) { |
| 270 extensions::SuspiciousExtensionBubbleView::MaybeShow(browser_, app_menu_); | 270 extensions::ExtensionMessageBubbleView::MaybeShow( |
| 271 browser_, this, app_menu_); |
| 271 GetWidget()->RemoveObserver(this); | 272 GetWidget()->RemoveObserver(this); |
| 272 } | 273 } |
| 273 } | 274 } |
| 274 | 275 |
| 275 void ToolbarView::Update(WebContents* tab) { | 276 void ToolbarView::Update(WebContents* tab) { |
| 276 if (location_bar_) | 277 if (location_bar_) |
| 277 location_bar_->Update(tab); | 278 location_bar_->Update(tab); |
| 278 if (site_chip_view_->ShouldShow()) | 279 if (site_chip_view_->ShouldShow()) |
| 279 site_chip_view_->Update(tab); | 280 site_chip_view_->Update(tab); |
| 280 | 281 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 839 |
| 839 void ToolbarView::OnShowHomeButtonChanged() { | 840 void ToolbarView::OnShowHomeButtonChanged() { |
| 840 Layout(); | 841 Layout(); |
| 841 SchedulePaint(); | 842 SchedulePaint(); |
| 842 } | 843 } |
| 843 | 844 |
| 844 int ToolbarView::content_shadow_height() const { | 845 int ToolbarView::content_shadow_height() const { |
| 845 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 846 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
| 846 kContentShadowHeightAsh : kContentShadowHeight; | 847 kContentShadowHeightAsh : kContentShadowHeight; |
| 847 } | 848 } |
| OLD | NEW |