Chromium Code Reviews| 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)); |