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

Side by Side Diff: chrome/browser/ui/toolbar/app_menu_icon_controller.h

Issue 2925973002: Migrate upgrade notifications to observer (Closed)
Patch Set: Add DISALLOW_COPY_AND_ASSIGN Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/upgrade_observer.h"
9 #include "content/public/browser/notification_details.h" 10 #include "content/public/browser/notification_details.h"
10 #include "content/public/browser/notification_observer.h" 11 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h" 12 #include "content/public/browser/notification_registrar.h"
12 #include "content/public/browser/notification_service.h" 13 #include "content/public/browser/notification_service.h"
13 14
14 #if defined(OS_WIN) 15 #if defined(OS_WIN)
15 #include "chrome/browser/win/enumerate_modules_model.h" 16 #include "chrome/browser/win/enumerate_modules_model.h"
16 #endif 17 #endif
17 18
18 class Profile; 19 class Profile;
19 20
20 // AppMenuIconController encapsulates the logic for badging the app menu icon 21 // AppMenuIconController encapsulates the logic for badging the app menu icon
21 // as a result of various events - such as available updates, errors, etc. 22 // as a result of various events - such as available updates, errors, etc.
22 class AppMenuIconController : 23 class AppMenuIconController :
23 #if defined(OS_WIN) 24 #if defined(OS_WIN)
24 public EnumerateModulesModel::Observer, 25 public EnumerateModulesModel::Observer,
25 #endif 26 #endif
26 public content::NotificationObserver { 27 public content::NotificationObserver,
28 public UpgradeObserver {
27 public: 29 public:
28 enum class IconType { 30 enum class IconType {
29 NONE, 31 NONE,
30 UPGRADE_NOTIFICATION, 32 UPGRADE_NOTIFICATION,
31 GLOBAL_ERROR, 33 GLOBAL_ERROR,
32 INCOMPATIBILITY_WARNING, 34 INCOMPATIBILITY_WARNING,
33 }; 35 };
34 enum class Severity { 36 enum class Severity {
35 NONE, 37 NONE,
36 LOW, 38 LOW,
(...skipping 25 matching lines...) Expand all
62 // etc. and based on that information trigger an appropriate call to the 64 // etc. and based on that information trigger an appropriate call to the
63 // delegate. 65 // delegate.
64 void UpdateDelegate(); 66 void UpdateDelegate();
65 67
66 private: 68 private:
67 // content::NotificationObserver: 69 // content::NotificationObserver:
68 void Observe(int type, 70 void Observe(int type,
69 const content::NotificationSource& source, 71 const content::NotificationSource& source,
70 const content::NotificationDetails& details) override; 72 const content::NotificationDetails& details) override;
71 73
74 // UpgradeObserver implementation.
75 void OnUpgradeRecommended() override;
76
72 #if defined(OS_WIN) 77 #if defined(OS_WIN)
73 // EnumerateModulesModel: 78 // EnumerateModulesModel:
74 void OnScanCompleted() override; 79 void OnScanCompleted() override;
75 void OnConflictsAcknowledged() override; 80 void OnConflictsAcknowledged() override;
76 #endif 81 #endif
77 82
78 Profile* profile_; 83 Profile* profile_;
79 Delegate* delegate_; 84 Delegate* delegate_;
80 content::NotificationRegistrar registrar_; 85 content::NotificationRegistrar registrar_;
81 86
82 DISALLOW_COPY_AND_ASSIGN(AppMenuIconController); 87 DISALLOW_COPY_AND_ASSIGN(AppMenuIconController);
83 }; 88 };
84 89
85 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_ 90 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | chrome/browser/ui/toolbar/app_menu_icon_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698