OLD | NEW |
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/ui/toolbar/app_menu_icon_painter.h" | 9 #include "chrome/browser/ui/toolbar/app_menu_icon_painter.h" |
10 #include "content/public/browser/notification_details.h" | 10 #include "content/public/browser/notification_details.h" |
11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 | 14 |
| 15 #if defined(OS_WIN) |
| 16 #include "chrome/browser/win/enumerate_modules_model.h" |
| 17 #endif |
| 18 |
15 class Profile; | 19 class Profile; |
16 | 20 |
17 // AppMenuIconController encapsulates the logic for badging the app menu icon | 21 // AppMenuIconController encapsulates the logic for badging the app menu icon |
18 // 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. |
19 class AppMenuIconController : public content::NotificationObserver { | 23 class AppMenuIconController : |
| 24 #if defined(OS_WIN) |
| 25 public EnumerateModulesModel::Observer, |
| 26 #endif |
| 27 public content::NotificationObserver { |
20 public: | 28 public: |
21 enum class IconType { | 29 enum class IconType { |
22 NONE, | 30 NONE, |
23 UPGRADE_NOTIFICATION, | 31 UPGRADE_NOTIFICATION, |
24 GLOBAL_ERROR, | 32 GLOBAL_ERROR, |
25 INCOMPATIBILITY_WARNING, | 33 INCOMPATIBILITY_WARNING, |
26 }; | 34 }; |
27 | 35 |
28 // Delegate interface for receiving icon update notifications. | 36 // Delegate interface for receiving icon update notifications. |
29 class Delegate { | 37 class Delegate { |
(...skipping 19 matching lines...) Expand all Loading... |
49 // etc. and based on that information trigger an appropriate call to the | 57 // etc. and based on that information trigger an appropriate call to the |
50 // delegate. | 58 // delegate. |
51 void UpdateDelegate(); | 59 void UpdateDelegate(); |
52 | 60 |
53 private: | 61 private: |
54 // content::NotificationObserver: | 62 // content::NotificationObserver: |
55 void Observe(int type, | 63 void Observe(int type, |
56 const content::NotificationSource& source, | 64 const content::NotificationSource& source, |
57 const content::NotificationDetails& details) override; | 65 const content::NotificationDetails& details) override; |
58 | 66 |
| 67 #if defined(OS_WIN) |
| 68 // EnumerateModulesModel: |
| 69 void OnScanCompleted() override; |
| 70 void OnConflictsAcknowledged() override; |
| 71 #endif |
| 72 |
59 Profile* profile_; | 73 Profile* profile_; |
60 Delegate* delegate_; | 74 Delegate* delegate_; |
61 content::NotificationRegistrar registrar_; | 75 content::NotificationRegistrar registrar_; |
62 | 76 |
63 DISALLOW_COPY_AND_ASSIGN(AppMenuIconController); | 77 DISALLOW_COPY_AND_ASSIGN(AppMenuIconController); |
64 }; | 78 }; |
65 | 79 |
66 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_ | 80 #endif // CHROME_BROWSER_UI_TOOLBAR_APP_MENU_ICON_CONTROLLER_H_ |
OLD | NEW |