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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/trace_event/trace_event.h" | 12 #include "base/trace_event/trace_event.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/app/chrome_command_ids.h" | 14 #include "chrome/app/chrome_command_ids.h" |
15 #include "chrome/app/vector_icons/vector_icons.h" | |
15 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
16 #include "chrome/browser/command_updater.h" | 17 #include "chrome/browser/command_updater.h" |
17 #include "chrome/browser/extensions/extension_util.h" | 18 #include "chrome/browser/extensions/extension_util.h" |
18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/themes/theme_properties.h" | 20 #include "chrome/browser/themes/theme_properties.h" |
20 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" | 21 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" |
21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_command_controller.h" | 23 #include "chrome/browser/ui/browser_command_controller.h" |
23 #include "chrome/browser/ui/browser_commands.h" | 24 #include "chrome/browser/ui/browser_commands.h" |
24 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 25 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 #include "content/public/browser/web_contents.h" | 62 #include "content/public/browser/web_contents.h" |
62 #include "ui/accessibility/ax_node_data.h" | 63 #include "ui/accessibility/ax_node_data.h" |
63 #include "ui/base/l10n/l10n_util.h" | 64 #include "ui/base/l10n/l10n_util.h" |
64 #include "ui/base/material_design/material_design_controller.h" | 65 #include "ui/base/material_design/material_design_controller.h" |
65 #include "ui/base/theme_provider.h" | 66 #include "ui/base/theme_provider.h" |
66 #include "ui/base/window_open_disposition.h" | 67 #include "ui/base/window_open_disposition.h" |
67 #include "ui/compositor/layer.h" | 68 #include "ui/compositor/layer.h" |
68 #include "ui/gfx/canvas.h" | 69 #include "ui/gfx/canvas.h" |
69 #include "ui/gfx/image/canvas_image_source.h" | 70 #include "ui/gfx/image/canvas_image_source.h" |
70 #include "ui/gfx/paint_vector_icon.h" | 71 #include "ui/gfx/paint_vector_icon.h" |
71 #include "ui/gfx/vector_icons_public.h" | |
72 #include "ui/keyboard/keyboard_controller.h" | 72 #include "ui/keyboard/keyboard_controller.h" |
73 #include "ui/native_theme/native_theme_aura.h" | 73 #include "ui/native_theme/native_theme_aura.h" |
74 #include "ui/views/focus/view_storage.h" | 74 #include "ui/views/focus/view_storage.h" |
75 #include "ui/views/widget/tooltip_manager.h" | 75 #include "ui/views/widget/tooltip_manager.h" |
76 #include "ui/views/widget/widget.h" | 76 #include "ui/views/widget/widget.h" |
77 #include "ui/views/window/non_client_view.h" | 77 #include "ui/views/window/non_client_view.h" |
78 | 78 |
79 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
80 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" | 80 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" |
81 #include "chrome/browser/ui/views/conflicting_module_view_win.h" | 81 #include "chrome/browser/ui/views/conflicting_module_view_win.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 void ToolbarView::LoadImages() { | 741 void ToolbarView::LoadImages() { |
742 const ui::ThemeProvider* tp = GetThemeProvider(); | 742 const ui::ThemeProvider* tp = GetThemeProvider(); |
743 | 743 |
744 const SkColor normal_color = | 744 const SkColor normal_color = |
745 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); | 745 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
746 const SkColor disabled_color = | 746 const SkColor disabled_color = |
747 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE); | 747 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE); |
748 | 748 |
749 back_->SetImage( | 749 back_->SetImage( |
750 views::Button::STATE_NORMAL, | 750 views::Button::STATE_NORMAL, |
751 gfx::CreateVectorIcon(gfx::VectorIconId::NAVIGATE_BACK, normal_color)); | 751 gfx::CreateVectorIcon(kNavigateBackIcon, normal_color)); |
752 back_->SetImage( | 752 back_->SetImage( |
753 views::Button::STATE_DISABLED, | 753 views::Button::STATE_DISABLED, |
754 gfx::CreateVectorIcon(gfx::VectorIconId::NAVIGATE_BACK, disabled_color)); | 754 gfx::CreateVectorIcon(kNavigateBackIcon, normal_color)); |
Evan Stade
2017/01/11 02:25:42
oops
| |
755 forward_->SetImage( | 755 forward_->SetImage( |
756 views::Button::STATE_NORMAL, | 756 views::Button::STATE_NORMAL, |
757 gfx::CreateVectorIcon(gfx::VectorIconId::NAVIGATE_FORWARD, normal_color)); | 757 gfx::CreateVectorIcon(kNavigateForwardIcon, normal_color)); |
758 forward_->SetImage(views::Button::STATE_DISABLED, | 758 forward_->SetImage( |
759 gfx::CreateVectorIcon(gfx::VectorIconId::NAVIGATE_FORWARD, | 759 views::Button::STATE_DISABLED, |
760 disabled_color)); | 760 gfx::CreateVectorIcon(kNavigateForwardIcon, disabled_color)); |
761 home_->SetImage( | 761 home_->SetImage(views::Button::STATE_NORMAL, |
762 views::Button::STATE_NORMAL, | 762 gfx::CreateVectorIcon(kNavigateHomeIcon, normal_color)); |
763 gfx::CreateVectorIcon(gfx::VectorIconId::NAVIGATE_HOME, normal_color)); | |
764 app_menu_button_->UpdateIcon(); | 763 app_menu_button_->UpdateIcon(); |
765 | 764 |
766 back_->set_ink_drop_base_color(normal_color); | 765 back_->set_ink_drop_base_color(normal_color); |
767 forward_->set_ink_drop_base_color(normal_color); | 766 forward_->set_ink_drop_base_color(normal_color); |
768 home_->set_ink_drop_base_color(normal_color); | 767 home_->set_ink_drop_base_color(normal_color); |
769 app_menu_button_->set_ink_drop_base_color(normal_color); | 768 app_menu_button_->set_ink_drop_base_color(normal_color); |
770 | 769 |
771 reload_->LoadImages(); | 770 reload_->LoadImages(); |
772 } | 771 } |
773 | 772 |
774 void ToolbarView::ShowCriticalNotification() { | 773 void ToolbarView::ShowCriticalNotification() { |
775 #if defined(OS_WIN) | 774 #if defined(OS_WIN) |
776 views::BubbleDialogDelegateView::CreateBubble( | 775 views::BubbleDialogDelegateView::CreateBubble( |
777 new CriticalNotificationBubbleView(app_menu_button_))->Show(); | 776 new CriticalNotificationBubbleView(app_menu_button_))->Show(); |
778 #endif | 777 #endif |
779 } | 778 } |
780 | 779 |
781 void ToolbarView::ShowOutdatedInstallNotification(bool auto_update_enabled) { | 780 void ToolbarView::ShowOutdatedInstallNotification(bool auto_update_enabled) { |
782 if (OutdatedUpgradeBubbleView::IsAvailable()) { | 781 if (OutdatedUpgradeBubbleView::IsAvailable()) { |
783 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, | 782 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, |
784 auto_update_enabled); | 783 auto_update_enabled); |
785 } | 784 } |
786 } | 785 } |
787 | 786 |
788 void ToolbarView::OnShowHomeButtonChanged() { | 787 void ToolbarView::OnShowHomeButtonChanged() { |
789 Layout(); | 788 Layout(); |
790 SchedulePaint(); | 789 SchedulePaint(); |
791 } | 790 } |
OLD | NEW |