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

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

Issue 11440020: Add an outdated upgrade bubble view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only check for policy on CHROME_BUILD. Created 7 years, 11 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
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 31a19cc6324c566393527ee1323620b2421a7c41..2e61d82802229a9f41b3316dad7fbd98dcc14a1f 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
#include "chrome/browser/ui/views/location_bar/star_view.h"
+#include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h"
#include "chrome/browser/ui/views/wrench_menu.h"
#include "chrome/browser/upgrade_detector.h"
#include "chrome/common/chrome_notification_types.h"
@@ -188,6 +189,12 @@ ToolbarView::ToolbarView(Browser* browser)
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
content::NotificationService::AllSources());
+// This should only be available on non-Chrome OS desktop platforms.
+#if defined(OS_WIN) || defined(OS_MACOSX) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ registrar_.Add(this, chrome::NOTIFICATION_OUTDATED_INSTALL,
+ content::NotificationService::AllSources());
+#endif
#if defined(OS_WIN)
registrar_.Add(this, chrome::NOTIFICATION_CRITICAL_UPGRADE_INSTALLED,
content::NotificationService::AllSources());
@@ -548,6 +555,12 @@ void ToolbarView::Observe(int type,
case chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED:
UpdateAppMenuState();
break;
+#if defined(OS_WIN) || defined(OS_MACOSX) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ case chrome::NOTIFICATION_OUTDATED_INSTALL:
+ ShowOutdatedInstallNotification();
+ break;
+#endif
#if defined(OS_WIN)
case chrome::NOTIFICATION_CRITICAL_UPGRADE_INSTALLED:
ShowCriticalNotification();
@@ -893,6 +906,14 @@ void ToolbarView::ShowCriticalNotification() {
#endif
}
+void ToolbarView::ShowOutdatedInstallNotification() {
+// This should only work on non-Chrome OS desktop platforms.
+#if defined(OS_WIN) || defined(OS_MACOSX) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ OutdatedUpgradeBubbleView::ShowBubble(app_menu_, browser_);
+#endif
+}
+
void ToolbarView::UpdateAppMenuState() {
string16 accname_app = l10n_util::GetStringUTF16(IDS_ACCNAME_APP);
if (ShouldShowUpgradeRecommended()) {

Powered by Google App Engine
This is Rietveld 408576698