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

Unified Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 8142028: When critical updates have been installed and the user has been idle for quite some time, show a ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/toolbar_view.cc
===================================================================
--- chrome/browser/ui/views/toolbar_view.cc (revision 104705)
+++ chrome/browser/ui/views/toolbar_view.cc (working copy)
@@ -43,6 +43,7 @@
#if defined(OS_WIN)
#include "chrome/browser/enumerate_modules_model_win.h"
+#include "chrome/browser/ui/views/critical_notification_bubble_view.h"
Ben Goodger (Google) 2011/10/12 15:10:45 this should go in the !defined(USE_AURA) bit
#if !defined(USE_AURA)
#include "chrome/browser/ui/views/app_menu_button_win.h"
#endif
@@ -115,6 +116,10 @@
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
NotificationService::AllSources());
+#if defined(OS_WIN)
Ben Goodger (Google) 2011/10/12 15:10:45 && !defined(USE_AURA)
+ registrar_.Add(this, chrome::NOTIFICATION_CRITICAL_UPGRADE_INSTALLED,
+ NotificationService::AllSources());
+#endif
registrar_.Add(this,
chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE,
NotificationService::AllSources());
@@ -421,6 +426,11 @@
case chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED:
UpdateAppMenuBadge();
break;
+#if defined(OS_WIN)
Ben Goodger (Google) 2011/10/12 15:10:45 && !defined(USE_AURA)
+ case chrome::NOTIFICATION_CRITICAL_UPGRADE_INSTALLED:
+ ShowCriticalNotification();
+ break;
+#endif
default:
NOTREACHED();
}
@@ -711,6 +721,23 @@
app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED));
}
+void ToolbarView::ShowCriticalNotification() {
+#if defined(OS_WIN)
Ben Goodger (Google) 2011/10/12 15:10:45 && !defined(USE_AURA)
+ gfx::Point screen_loc;
+ views::View::ConvertPointToScreen(app_menu_, &screen_loc);
+
+ CriticalNotificationBubbleView* critical_notification_bubble =
+ new CriticalNotificationBubbleView();
+ Bubble* bubble = Bubble::Show(GetWidget(),
+ gfx::Rect(screen_loc, app_menu_->size()),
+ views::BubbleBorder::TOP_RIGHT,
+ critical_notification_bubble,
+ critical_notification_bubble);
+ bubble->set_close_on_deactivate(false);
+ critical_notification_bubble->set_bubble(bubble);
+#endif
+}
+
void ToolbarView::UpdateAppMenuBadge() {
app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL));
app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT));

Powered by Google App Engine
This is Rietveld 408576698