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

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: Refactoring based on latest review comments. 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 256773e2a41b7a5e3583b190da8b902ac0486c6e..878c0de89e2fcf6743d84e396f0e738347da2d9a 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/ui/views/home_button.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"
@@ -189,6 +190,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());
@@ -549,6 +556,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();
@@ -894,6 +907,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