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

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

Issue 1966643002: Integrate new MD update menu icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Uses the BadgeType to select the severity-warning icon. Created 4 years, 7 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // Showing the bubble requires |app_menu_button_| to be in a widget. See 657 // Showing the bubble requires |app_menu_button_| to be in a widget. See
658 // comment in ConflictingModuleView for details. 658 // comment in ConflictingModuleView for details.
659 DCHECK(app_menu_button_->GetWidget()); 659 DCHECK(app_menu_button_->GetWidget());
660 660
661 base::string16 accname_app = l10n_util::GetStringUTF16(IDS_ACCNAME_APP); 661 base::string16 accname_app = l10n_util::GetStringUTF16(IDS_ACCNAME_APP);
662 if (type == AppMenuBadgeController::BADGE_TYPE_UPGRADE_NOTIFICATION) { 662 if (type == AppMenuBadgeController::BADGE_TYPE_UPGRADE_NOTIFICATION) {
663 accname_app = l10n_util::GetStringFUTF16( 663 accname_app = l10n_util::GetStringFUTF16(
664 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); 664 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app);
665 } 665 }
666 app_menu_button_->SetAccessibleName(accname_app); 666 app_menu_button_->SetAccessibleName(accname_app);
667 app_menu_button_->SetSeverity(severity, animate); 667 app_menu_button_->SetSeverity(severity, type, animate);
668 668
669 // Keep track of whether we were showing the badge before, so we don't send 669 // Keep track of whether we were showing the badge before, so we don't send
670 // multiple UMA events for example when multiple Chrome windows are open. 670 // multiple UMA events for example when multiple Chrome windows are open.
671 static bool incompatibility_badge_showing = false; 671 static bool incompatibility_badge_showing = false;
672 // Save the old value before resetting it. 672 // Save the old value before resetting it.
673 bool was_showing = incompatibility_badge_showing; 673 bool was_showing = incompatibility_badge_showing;
674 incompatibility_badge_showing = false; 674 incompatibility_badge_showing = false;
675 675
676 if (type == AppMenuBadgeController::BADGE_TYPE_INCOMPATIBILITY_WARNING) { 676 if (type == AppMenuBadgeController::BADGE_TYPE_INCOMPATIBILITY_WARNING) {
677 if (!was_showing) { 677 if (!was_showing) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 SchedulePaint(); 797 SchedulePaint();
798 } 798 }
799 799
800 int ToolbarView::content_shadow_height() const { 800 int ToolbarView::content_shadow_height() const {
801 #if defined(USE_ASH) 801 #if defined(USE_ASH)
802 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH); 802 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH);
803 #else 803 #else
804 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT); 804 return GetLayoutConstant(TOOLBAR_CONTENT_SHADOW_HEIGHT);
805 #endif 805 #endif
806 } 806 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698