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

Side by Side Diff: chrome/browser/ui/ash/system_tray_client.h

Issue 2882933002: Add update available icon in system tray (Closed)
Patch Set: Add file to BUILD.gn Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_ASH_SYSTEM_TRAY_CLIENT_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_
7 7
8 #include "ash/public/interfaces/system_tray.mojom.h" 8 #include "ash/public/interfaces/system_tray.mojom.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/chromeos/system/system_clock_observer.h" 10 #include "chrome/browser/chromeos/system/system_clock_observer.h"
11 #include "chrome/browser/upgrade_observer.h"
11 #include "components/policy/core/common/cloud/cloud_policy_store.h" 12 #include "components/policy/core/common/cloud/cloud_policy_store.h"
12 #include "content/public/browser/notification_observer.h" 13 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h" 14 #include "content/public/browser/notification_registrar.h"
14 #include "mojo/public/cpp/bindings/binding.h" 15 #include "mojo/public/cpp/bindings/binding.h"
15 16
16 namespace ash { 17 namespace ash {
17 enum class LoginStatus; 18 enum class LoginStatus;
18 } 19 }
19 20
20 namespace views { 21 namespace views {
21 class Widget; 22 class Widget;
22 class WidgetDelegate; 23 class WidgetDelegate;
23 } 24 }
24 25
25 // Handles method calls delegated back to chrome from ash. Also notifies ash of 26 // Handles method calls delegated back to chrome from ash. Also notifies ash of
26 // relevant state changes in chrome. 27 // relevant state changes in chrome.
27 // TODO: Consider renaming this to SystemTrayClientChromeOS. 28 // TODO: Consider renaming this to SystemTrayClientChromeOS.
28 class SystemTrayClient : public ash::mojom::SystemTrayClient, 29 class SystemTrayClient : public ash::mojom::SystemTrayClient,
29 public chromeos::system::SystemClockObserver, 30 public chromeos::system::SystemClockObserver,
30 public policy::CloudPolicyStore::Observer, 31 public policy::CloudPolicyStore::Observer,
31 public content::NotificationObserver { 32 public content::NotificationObserver,
33 public UpgradeObserver {
32 public: 34 public:
33 SystemTrayClient(); 35 SystemTrayClient();
34 ~SystemTrayClient() override; 36 ~SystemTrayClient() override;
35 37
36 static SystemTrayClient* Get(); 38 static SystemTrayClient* Get();
37 39
38 // Returns the login state based on the user type, lock screen status, etc. 40 // Returns the login state based on the user type, lock screen status, etc.
39 static ash::LoginStatus GetUserLoginStatus(); 41 static ash::LoginStatus GetUserLoginStatus();
40 42
41 // Returns the container id for the parent window for new dialogs. The parent 43 // Returns the container id for the parent window for new dialogs. The parent
(...skipping 20 matching lines...) Expand all
62 void ShowBluetoothPairingDialog(const std::string& address, 64 void ShowBluetoothPairingDialog(const std::string& address,
63 const base::string16& name_for_display, 65 const base::string16& name_for_display,
64 bool paired, 66 bool paired,
65 bool connected) override; 67 bool connected) override;
66 void ShowDateSettings() override; 68 void ShowDateSettings() override;
67 void ShowSetTimeDialog() override; 69 void ShowSetTimeDialog() override;
68 void ShowDisplaySettings() override; 70 void ShowDisplaySettings() override;
69 void ShowPowerSettings() override; 71 void ShowPowerSettings() override;
70 void ShowChromeSlow() override; 72 void ShowChromeSlow() override;
71 void ShowIMESettings() override; 73 void ShowIMESettings() override;
74 void ShowAboutChromeOS() override;
72 void ShowHelp() override; 75 void ShowHelp() override;
73 void ShowAccessibilityHelp() override; 76 void ShowAccessibilityHelp() override;
74 void ShowAccessibilitySettings() override; 77 void ShowAccessibilitySettings() override;
75 void ShowPaletteHelp() override; 78 void ShowPaletteHelp() override;
76 void ShowPaletteSettings() override; 79 void ShowPaletteSettings() override;
77 void ShowPublicAccountInfo() override; 80 void ShowPublicAccountInfo() override;
78 void ShowEnterpriseInfo() override; 81 void ShowEnterpriseInfo() override;
79 void ShowNetworkConfigure(const std::string& network_id) override; 82 void ShowNetworkConfigure(const std::string& network_id) override;
80 void ShowNetworkCreate(const std::string& type) override; 83 void ShowNetworkCreate(const std::string& type) override;
81 void ShowThirdPartyVpnCreate(const std::string& extension_id) override; 84 void ShowThirdPartyVpnCreate(const std::string& extension_id) override;
82 void ShowNetworkSettings(const std::string& network_id) override; 85 void ShowNetworkSettings(const std::string& network_id) override;
83 void ShowProxySettings() override; 86 void ShowProxySettings() override;
84 void SignOut() override; 87 void SignOut() override;
85 void RequestRestartForUpdate() override; 88 void RequestRestartForUpdate() override;
86 89
87 private: 90 private:
88 // Helper function shared by ShowNetworkSettings() and ShowNetworkConfigure(). 91 // Helper function shared by ShowNetworkSettings() and ShowNetworkConfigure().
89 void ShowNetworkSettingsHelper(const std::string& network_id, 92 void ShowNetworkSettingsHelper(const std::string& network_id,
90 bool show_configure); 93 bool show_configure);
91 94
92 // Requests that ash show the update available icon. 95 // Requests that ash show the update available icon.
93 void HandleUpdateAvailable(); 96 void HandleUpdateAvailable();
94 97
98 // Requests that ash show the update over cellular available icon.
99 void HandleUpdateOverCellularAvailable();
100
95 // chromeos::system::SystemClockObserver: 101 // chromeos::system::SystemClockObserver:
96 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override; 102 void OnSystemClockChanged(chromeos::system::SystemClock* clock) override;
97 103
104 // UpgradeObserver:
105 void OnUpdateOverCellularAvailable() override;
106
98 // policy::CloudPolicyStore::Observer 107 // policy::CloudPolicyStore::Observer
99 void OnStoreLoaded(policy::CloudPolicyStore* store) override; 108 void OnStoreLoaded(policy::CloudPolicyStore* store) override;
100 void OnStoreError(policy::CloudPolicyStore* store) override; 109 void OnStoreError(policy::CloudPolicyStore* store) override;
101 110
102 void UpdateEnterpriseDomain(); 111 void UpdateEnterpriseDomain();
103 112
104 // content::NotificationObserver: 113 // content::NotificationObserver:
105 void Observe(int type, 114 void Observe(int type,
106 const content::NotificationSource& source, 115 const content::NotificationSource& source,
107 const content::NotificationDetails& details) override; 116 const content::NotificationDetails& details) override;
(...skipping 11 matching lines...) Expand all
119 // duplicate IPCs during the session. 128 // duplicate IPCs during the session.
120 std::string last_enterprise_domain_; 129 std::string last_enterprise_domain_;
121 bool last_active_directory_managed_ = false; 130 bool last_active_directory_managed_ = false;
122 131
123 content::NotificationRegistrar registrar_; 132 content::NotificationRegistrar registrar_;
124 133
125 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient); 134 DISALLOW_COPY_AND_ASSIGN(SystemTrayClient);
126 }; 135 };
127 136
128 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_ 137 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/about_page/about_page.js ('k') | chrome/browser/ui/ash/system_tray_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698