Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_view.cc

Issue 2656463002: Implement MD simple gesture nav (Closed)
Patch Set: Rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "ui/base/l10n/l10n_util.h" 64 #include "ui/base/l10n/l10n_util.h"
65 #include "ui/base/material_design/material_design_controller.h" 65 #include "ui/base/material_design/material_design_controller.h"
66 #include "ui/base/theme_provider.h" 66 #include "ui/base/theme_provider.h"
67 #include "ui/base/window_open_disposition.h" 67 #include "ui/base/window_open_disposition.h"
68 #include "ui/compositor/layer.h" 68 #include "ui/compositor/layer.h"
69 #include "ui/gfx/canvas.h" 69 #include "ui/gfx/canvas.h"
70 #include "ui/gfx/image/canvas_image_source.h" 70 #include "ui/gfx/image/canvas_image_source.h"
71 #include "ui/gfx/paint_vector_icon.h" 71 #include "ui/gfx/paint_vector_icon.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/vector_icons/vector_icons.h"
74 #include "ui/views/focus/view_storage.h" 75 #include "ui/views/focus/view_storage.h"
75 #include "ui/views/widget/tooltip_manager.h" 76 #include "ui/views/widget/tooltip_manager.h"
76 #include "ui/views/widget/widget.h" 77 #include "ui/views/widget/widget.h"
77 #include "ui/views/window/non_client_view.h" 78 #include "ui/views/window/non_client_view.h"
78 79
79 #if defined(OS_WIN) 80 #if defined(OS_WIN)
80 #include "chrome/browser/recovery/recovery_install_global_error_factory.h" 81 #include "chrome/browser/recovery/recovery_install_global_error_factory.h"
81 #include "chrome/browser/ui/views/conflicting_module_view_win.h" 82 #include "chrome/browser/ui/views/conflicting_module_view_win.h"
82 #include "chrome/browser/ui/views/critical_notification_bubble_view.h" 83 #include "chrome/browser/ui/views/critical_notification_bubble_view.h"
83 #endif 84 #endif
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 736 }
736 737
737 void ToolbarView::LoadImages() { 738 void ToolbarView::LoadImages() {
738 const ui::ThemeProvider* tp = GetThemeProvider(); 739 const ui::ThemeProvider* tp = GetThemeProvider();
739 740
740 const SkColor normal_color = 741 const SkColor normal_color =
741 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); 742 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON);
742 const SkColor disabled_color = 743 const SkColor disabled_color =
743 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE); 744 tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE);
744 745
745 back_->SetImage( 746 back_->SetImage(views::Button::STATE_NORMAL,
746 views::Button::STATE_NORMAL, 747 gfx::CreateVectorIcon(ui::kBackArrowIcon, normal_color));
747 gfx::CreateVectorIcon(kNavigateBackIcon, normal_color)); 748 back_->SetImage(views::Button::STATE_DISABLED,
748 back_->SetImage( 749 gfx::CreateVectorIcon(ui::kBackArrowIcon, disabled_color));
749 views::Button::STATE_DISABLED,
750 gfx::CreateVectorIcon(kNavigateBackIcon, disabled_color));
751 forward_->SetImage( 750 forward_->SetImage(
752 views::Button::STATE_NORMAL, 751 views::Button::STATE_NORMAL,
753 gfx::CreateVectorIcon(kNavigateForwardIcon, normal_color)); 752 gfx::CreateVectorIcon(ui::kForwardArrowIcon, normal_color));
754 forward_->SetImage( 753 forward_->SetImage(
755 views::Button::STATE_DISABLED, 754 views::Button::STATE_DISABLED,
756 gfx::CreateVectorIcon(kNavigateForwardIcon, disabled_color)); 755 gfx::CreateVectorIcon(ui::kForwardArrowIcon, disabled_color));
757 home_->SetImage(views::Button::STATE_NORMAL, 756 home_->SetImage(views::Button::STATE_NORMAL,
758 gfx::CreateVectorIcon(kNavigateHomeIcon, normal_color)); 757 gfx::CreateVectorIcon(kNavigateHomeIcon, normal_color));
759 app_menu_button_->UpdateIcon(); 758 app_menu_button_->UpdateIcon();
760 759
761 back_->set_ink_drop_base_color(normal_color); 760 back_->set_ink_drop_base_color(normal_color);
762 forward_->set_ink_drop_base_color(normal_color); 761 forward_->set_ink_drop_base_color(normal_color);
763 home_->set_ink_drop_base_color(normal_color); 762 home_->set_ink_drop_base_color(normal_color);
764 app_menu_button_->set_ink_drop_base_color(normal_color); 763 app_menu_button_->set_ink_drop_base_color(normal_color);
765 764
766 reload_->LoadImages(); 765 reload_->LoadImages();
(...skipping 10 matching lines...) Expand all
777 if (OutdatedUpgradeBubbleView::IsAvailable()) { 776 if (OutdatedUpgradeBubbleView::IsAvailable()) {
778 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, 777 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_,
779 auto_update_enabled); 778 auto_update_enabled);
780 } 779 }
781 } 780 }
782 781
783 void ToolbarView::OnShowHomeButtonChanged() { 782 void ToolbarView::OnShowHomeButtonChanged() {
784 Layout(); 783 Layout();
785 SchedulePaint(); 784 SchedulePaint();
786 } 785 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698