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/browser_actions_container.h" | 36 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
37 #include "chrome/browser/ui/views/toolbar/button_dropdown.h" | 37 #include "chrome/browser/ui/views/toolbar/button_dropdown.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/wrench_menu.h" | 40 #include "chrome/browser/ui/views/toolbar/wrench_menu.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 back_->SetTooltipText( | 252 back_->SetTooltipText( |
253 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); | 253 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_BACK)); |
254 forward_->SetTooltipText( | 254 forward_->SetTooltipText( |
255 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); | 255 l10n_util::GetStringUTF16(IDS_ACCNAME_TOOLTIP_FORWARD)); |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, | 259 void ToolbarView::OnWidgetVisibilityChanged(views::Widget* widget, |
260 bool visible) { | 260 bool visible) { |
261 if (visible) { | 261 if (visible) { |
262 extensions::SuspiciousExtensionBubbleView::MaybeShow(browser_, app_menu_); | 262 extensions::ExtensionMessageBubbleView::MaybeShow(browser_, app_menu_); |
263 GetWidget()->RemoveObserver(this); | 263 GetWidget()->RemoveObserver(this); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 void ToolbarView::Update(WebContents* tab) { | 267 void ToolbarView::Update(WebContents* tab) { |
268 if (location_bar_) | 268 if (location_bar_) |
269 location_bar_->Update(tab); | 269 location_bar_->Update(tab); |
270 | 270 |
271 if (browser_actions_) | 271 if (browser_actions_) |
272 browser_actions_->RefreshBrowserActionViews(); | 272 browser_actions_->RefreshBrowserActionViews(); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 | 813 |
814 void ToolbarView::OnShowHomeButtonChanged() { | 814 void ToolbarView::OnShowHomeButtonChanged() { |
815 Layout(); | 815 Layout(); |
816 SchedulePaint(); | 816 SchedulePaint(); |
817 } | 817 } |
818 | 818 |
819 int ToolbarView::content_shadow_height() const { | 819 int ToolbarView::content_shadow_height() const { |
820 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 820 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
821 kContentShadowHeightAsh : kContentShadowHeight; | 821 kContentShadowHeightAsh : kContentShadowHeight; |
822 } | 822 } |
OLD | NEW |