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

Side by Side Diff: chrome/browser/ui/views/critical_notification_bubble_view.cc

Issue 2576643002: Remove last vestigial uses of "update needed" png assets. (Closed)
Patch Set: rebase Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/critical_notification_bubble_view.h" 5 #include "chrome/browser/ui/views/critical_notification_bubble_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/lifetime/application_lifetime.h" 9 #include "chrome/browser/lifetime/application_lifetime.h"
10 #include "chrome/browser/upgrade_detector.h" 10 #include "chrome/browser/upgrade_detector.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 base::string16 CriticalNotificationBubbleView::GetWindowTitle() const { 83 base::string16 CriticalNotificationBubbleView::GetWindowTitle() const {
84 int seconds = GetRemainingTime(); 84 int seconds = GetRemainingTime();
85 return seconds > 0 ? l10n_util::GetPluralStringFUTF16( 85 return seconds > 0 ? l10n_util::GetPluralStringFUTF16(
86 IDS_CRITICAL_NOTIFICATION_HEADLINE, seconds) 86 IDS_CRITICAL_NOTIFICATION_HEADLINE, seconds)
87 : l10n_util::GetStringUTF16( 87 : l10n_util::GetStringUTF16(
88 IDS_CRITICAL_NOTIFICATION_HEADLINE_ALTERNATE); 88 IDS_CRITICAL_NOTIFICATION_HEADLINE_ALTERNATE);
89 } 89 }
90 90
91 gfx::ImageSkia CriticalNotificationBubbleView::GetWindowIcon() {
92 return *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
93 IDR_UPDATE_MENU_SEVERITY_HIGH);
94 }
95
96 bool CriticalNotificationBubbleView::ShouldShowWindowIcon() const {
97 return true;
98 }
99
100 void CriticalNotificationBubbleView::WindowClosing() { 91 void CriticalNotificationBubbleView::WindowClosing() {
101 refresh_timer_.Stop(); 92 refresh_timer_.Stop();
102 } 93 }
103 94
104 bool CriticalNotificationBubbleView::Cancel() { 95 bool CriticalNotificationBubbleView::Cancel() {
105 UpgradeDetector::GetInstance()->acknowledge_critical_update(); 96 UpgradeDetector::GetInstance()->acknowledge_critical_update();
106 content::RecordAction(UserMetricsAction("CriticalNotification_Ignore")); 97 content::RecordAction(UserMetricsAction("CriticalNotification_Ignore"));
107 // If the counter reaches 0, we set a restart flag that must be cleared if 98 // If the counter reaches 0, we set a restart flag that must be cleared if
108 // the user selects, for example, "Stay on this page" during an 99 // the user selects, for example, "Stay on this page" during an
109 // onbeforeunload handler. 100 // onbeforeunload handler.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void CriticalNotificationBubbleView::GetAccessibleNodeData( 141 void CriticalNotificationBubbleView::GetAccessibleNodeData(
151 ui::AXNodeData* node_data) { 142 ui::AXNodeData* node_data) {
152 node_data->role = ui::AX_ROLE_ALERT; 143 node_data->role = ui::AX_ROLE_ALERT;
153 } 144 }
154 145
155 void CriticalNotificationBubbleView::ViewHierarchyChanged( 146 void CriticalNotificationBubbleView::ViewHierarchyChanged(
156 const ViewHierarchyChangedDetails& details) { 147 const ViewHierarchyChangedDetails& details) {
157 if (details.is_add && details.child == this) 148 if (details.is_add && details.child == this)
158 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 149 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
159 } 150 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/critical_notification_bubble_view.h ('k') | chrome/browser/ui/views/outdated_upgrade_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698