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" |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 806 |
807 forward_->SetImage(views::Button::STATE_NORMAL, | 807 forward_->SetImage(views::Button::STATE_NORMAL, |
808 *(tp->GetImageSkiaNamed(IDR_FORWARD))); | 808 *(tp->GetImageSkiaNamed(IDR_FORWARD))); |
809 forward_->SetImage(views::Button::STATE_DISABLED, | 809 forward_->SetImage(views::Button::STATE_DISABLED, |
810 *(tp->GetImageSkiaNamed(IDR_FORWARD_D))); | 810 *(tp->GetImageSkiaNamed(IDR_FORWARD_D))); |
811 | 811 |
812 reload_->LoadImages(); | 812 reload_->LoadImages(); |
813 | 813 |
814 home_->SetImage(views::Button::STATE_NORMAL, | 814 home_->SetImage(views::Button::STATE_NORMAL, |
815 *(tp->GetImageSkiaNamed(IDR_HOME))); | 815 *(tp->GetImageSkiaNamed(IDR_HOME))); |
| 816 |
| 817 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 818 app_menu_->SetImage(views::Button::STATE_NORMAL, |
| 819 *(tp->GetImageSkiaNamed(IDR_TOOLS))); |
| 820 } |
816 } | 821 } |
817 | 822 |
818 void ToolbarView::ShowCriticalNotification() { | 823 void ToolbarView::ShowCriticalNotification() { |
819 #if defined(OS_WIN) | 824 #if defined(OS_WIN) |
820 CriticalNotificationBubbleView* bubble_delegate = | 825 CriticalNotificationBubbleView* bubble_delegate = |
821 new CriticalNotificationBubbleView(app_menu_); | 826 new CriticalNotificationBubbleView(app_menu_); |
822 views::BubbleDelegateView::CreateBubble(bubble_delegate)->Show(); | 827 views::BubbleDelegateView::CreateBubble(bubble_delegate)->Show(); |
823 #endif | 828 #endif |
824 } | 829 } |
825 | 830 |
826 void ToolbarView::ShowOutdatedInstallNotification(bool auto_update_enabled) { | 831 void ToolbarView::ShowOutdatedInstallNotification(bool auto_update_enabled) { |
827 if (OutdatedUpgradeBubbleView::IsAvailable()) { | 832 if (OutdatedUpgradeBubbleView::IsAvailable()) { |
828 OutdatedUpgradeBubbleView::ShowBubble( | 833 OutdatedUpgradeBubbleView::ShowBubble( |
829 app_menu_, browser_, auto_update_enabled); | 834 app_menu_, browser_, auto_update_enabled); |
830 } | 835 } |
831 } | 836 } |
832 | 837 |
833 void ToolbarView::OnShowHomeButtonChanged() { | 838 void ToolbarView::OnShowHomeButtonChanged() { |
834 Layout(); | 839 Layout(); |
835 SchedulePaint(); | 840 SchedulePaint(); |
836 } | 841 } |
837 | 842 |
838 int ToolbarView::content_shadow_height() const { | 843 int ToolbarView::content_shadow_height() const { |
839 ui::ThemeProvider* theme_provider = GetThemeProvider(); | 844 ui::ThemeProvider* theme_provider = GetThemeProvider(); |
840 return theme_provider->GetDisplayProperty( | 845 return theme_provider->GetDisplayProperty( |
841 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH | 846 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH |
842 ? ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH | 847 ? ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT_ASH |
843 : ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT); | 848 : ThemeProperties::PROPERTY_TOOLBAR_VIEW_CONTENT_SHADOW_HEIGHT); |
844 } | 849 } |
OLD | NEW |