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

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

Issue 2755643005: cros: Extract TrayBluetoothHelper from SystemTrayDelegateChromeOS (Closed)
Patch Set: rebase Created 3 years, 9 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DELEGATE_CHROMEOS_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 6 #define CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/common/accessibility_types.h" 14 #include "ash/common/accessibility_types.h"
15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h" 15 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h"
16 #include "ash/common/system/tray/ime_info.h" 16 #include "ash/common/system/tray/ime_info.h"
17 #include "ash/common/system/tray/system_tray_delegate.h" 17 #include "ash/common/system/tray/system_tray_delegate.h"
18 #include "base/callback_forward.h" 18 #include "base/callback_forward.h"
19 #include "base/callback_list.h" 19 #include "base/callback_list.h"
20 #include "base/compiler_specific.h"
21 #include "base/macros.h" 20 #include "base/macros.h"
22 #include "base/memory/ref_counted.h"
23 #include "base/memory/weak_ptr.h"
24 #include "base/observer_list.h" 21 #include "base/observer_list.h"
25 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 22 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
26 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/supervised_user/supervised_user_service_observer.h" 24 #include "chrome/browser/supervised_user/supervised_user_service_observer.h"
28 #include "chrome/browser/ui/browser_list_observer.h" 25 #include "chrome/browser/ui/browser_list_observer.h"
29 #include "chromeos/dbus/session_manager_client.h" 26 #include "chromeos/dbus/session_manager_client.h"
30 #include "components/policy/core/common/cloud/cloud_policy_store.h" 27 #include "components/policy/core/common/cloud/cloud_policy_store.h"
31 #include "components/prefs/pref_change_registrar.h" 28 #include "components/prefs/pref_change_registrar.h"
32 #include "components/signin/core/account_id/account_id.h" 29 #include "components/signin/core/account_id/account_id.h"
33 #include "components/user_manager/user_manager.h" 30 #include "components/user_manager/user_manager.h"
34 #include "content/public/browser/notification_observer.h" 31 #include "content/public/browser/notification_observer.h"
35 #include "content/public/browser/notification_registrar.h" 32 #include "content/public/browser/notification_registrar.h"
36 #include "device/bluetooth/bluetooth_adapter.h"
37 #include "device/bluetooth/bluetooth_discovery_session.h"
38 #include "extensions/browser/app_window/app_window_registry.h" 33 #include "extensions/browser/app_window/app_window_registry.h"
39 #include "ui/base/ime/chromeos/ime_keyboard.h" 34 #include "ui/base/ime/chromeos/ime_keyboard.h"
40 #include "ui/base/ime/chromeos/input_method_manager.h" 35 #include "ui/base/ime/chromeos/input_method_manager.h"
41 #include "ui/chromeos/ime/input_method_menu_manager.h" 36 #include "ui/chromeos/ime/input_method_menu_manager.h"
42 37
43 namespace ash { 38 namespace ash {
44 class SystemTrayNotifier; 39 class SystemTrayNotifier;
45 } 40 }
46 41
47 namespace user_manager { 42 namespace user_manager {
48 class User; 43 class User;
49 } 44 }
50 45
46 class TrayBluetoothHelper;
47
51 namespace chromeos { 48 namespace chromeos {
52 49
53 class SystemTrayDelegateChromeOS 50 class SystemTrayDelegateChromeOS
54 : public ui::ime::InputMethodMenuManager::Observer, 51 : public ui::ime::InputMethodMenuManager::Observer,
55 public ash::SystemTrayDelegate, 52 public ash::SystemTrayDelegate,
56 public SessionManagerClient::Observer, 53 public SessionManagerClient::Observer,
57 public content::NotificationObserver, 54 public content::NotificationObserver,
58 public input_method::InputMethodManager::Observer, 55 public input_method::InputMethodManager::Observer,
59 public device::BluetoothAdapter::Observer,
60 public policy::CloudPolicyStore::Observer, 56 public policy::CloudPolicyStore::Observer,
61 public chrome::BrowserListObserver, 57 public chrome::BrowserListObserver,
62 public extensions::AppWindowRegistry::Observer, 58 public extensions::AppWindowRegistry::Observer,
63 public user_manager::UserManager::Observer, 59 public user_manager::UserManager::Observer,
64 public user_manager::UserManager::UserSessionStateObserver, 60 public user_manager::UserManager::UserSessionStateObserver,
65 public SupervisedUserServiceObserver, 61 public SupervisedUserServiceObserver,
66 public input_method::InputMethodManager::ImeMenuObserver { 62 public input_method::InputMethodManager::ImeMenuObserver {
67 public: 63 public:
68 SystemTrayDelegateChromeOS(); 64 SystemTrayDelegateChromeOS();
69 65
70 ~SystemTrayDelegateChromeOS() override; 66 ~SystemTrayDelegateChromeOS() override;
71 67
72 void InitializeOnAdapterReady( 68 // Completes initialization after the Bluetooth adapter is ready.
73 scoped_refptr<device::BluetoothAdapter> adapter); 69 // TODO(jamescook): Eliminate this and just use Initialize().
70 // http://crbug.com/660043
71 void InitializeOnAdapterReady();
74 72
75 // Overridden from ash::SystemTrayDelegate: 73 // Overridden from ash::SystemTrayDelegate:
76 void Initialize() override; 74 void Initialize() override;
77 ash::LoginStatus GetUserLoginStatus() const override; 75 ash::LoginStatus GetUserLoginStatus() const override;
78 std::string GetEnterpriseDomain() const override; 76 std::string GetEnterpriseDomain() const override;
79 base::string16 GetEnterpriseMessage() const override; 77 base::string16 GetEnterpriseMessage() const override;
80 std::string GetSupervisedUserManager() const override; 78 std::string GetSupervisedUserManager() const override;
81 base::string16 GetSupervisedUserManagerName() const override; 79 base::string16 GetSupervisedUserManagerName() const override;
82 base::string16 GetSupervisedUserMessage() const override; 80 base::string16 GetSupervisedUserMessage() const override;
83 bool IsUserSupervised() const override; 81 bool IsUserSupervised() const override;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 163
166 // Overridden from InputMethodManager::Observer. 164 // Overridden from InputMethodManager::Observer.
167 void InputMethodChanged(input_method::InputMethodManager* manager, 165 void InputMethodChanged(input_method::InputMethodManager* manager,
168 Profile* profile, 166 Profile* profile,
169 bool show_message) override; 167 bool show_message) override;
170 168
171 // Overridden from InputMethodMenuManager::Observer. 169 // Overridden from InputMethodMenuManager::Observer.
172 void InputMethodMenuItemChanged( 170 void InputMethodMenuItemChanged(
173 ui::ime::InputMethodMenuManager* manager) override; 171 ui::ime::InputMethodMenuManager* manager) override;
174 172
175 // Overridden from BluetoothAdapter::Observer.
176 void AdapterPresentChanged(device::BluetoothAdapter* adapter,
177 bool present) override;
178 void AdapterPoweredChanged(device::BluetoothAdapter* adapter,
179 bool powered) override;
180 void AdapterDiscoveringChanged(device::BluetoothAdapter* adapter,
181 bool discovering) override;
182 void DeviceAdded(device::BluetoothAdapter* adapter,
183 device::BluetoothDevice* device) override;
184 void DeviceChanged(device::BluetoothAdapter* adapter,
185 device::BluetoothDevice* device) override;
186 void DeviceRemoved(device::BluetoothAdapter* adapter,
187 device::BluetoothDevice* device) override;
188
189 void OnStartBluetoothDiscoverySession(
190 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session);
191
192 void UpdateEnterpriseDomain(); 173 void UpdateEnterpriseDomain();
193 174
194 // Overridden from CloudPolicyStore::Observer 175 // Overridden from CloudPolicyStore::Observer
195 void OnStoreLoaded(policy::CloudPolicyStore* store) override; 176 void OnStoreLoaded(policy::CloudPolicyStore* store) override;
196 void OnStoreError(policy::CloudPolicyStore* store) override; 177 void OnStoreError(policy::CloudPolicyStore* store) override;
197 178
198 // Overridden from chrome::BrowserListObserver: 179 // Overridden from chrome::BrowserListObserver:
199 void OnBrowserRemoved(Browser* browser) override; 180 void OnBrowserRemoved(Browser* browser) override;
200 181
201 // Overridden from extensions::AppWindowRegistry::Observer: 182 // Overridden from extensions::AppWindowRegistry::Observer:
(...skipping 21 matching lines...) Expand all
223 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; 204 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_;
224 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; 205 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_;
225 Profile* user_profile_ = nullptr; 206 Profile* user_profile_ = nullptr;
226 int search_key_mapped_to_ = input_method::kSearchKey; 207 int search_key_mapped_to_ = input_method::kSearchKey;
227 bool have_session_start_time_ = false; 208 bool have_session_start_time_ = false;
228 base::TimeTicks session_start_time_; 209 base::TimeTicks session_start_time_;
229 bool have_session_length_limit_ = false; 210 bool have_session_length_limit_ = false;
230 base::TimeDelta session_length_limit_; 211 base::TimeDelta session_length_limit_;
231 std::string enterprise_domain_; 212 std::string enterprise_domain_;
232 bool is_active_directory_managed_ = false; 213 bool is_active_directory_managed_ = false;
233 bool should_run_bluetooth_discovery_ = false;
234 bool session_started_ = false; 214 bool session_started_ = false;
235 215
236 scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_; 216 // TODO(jamescook): Move into //ash. http://crbug.com/660043
237 std::unique_ptr<device::BluetoothDiscoverySession> 217 std::unique_ptr<TrayBluetoothHelper> bluetooth_helper_;
238 bluetooth_discovery_session_; 218
239 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_; 219 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_;
240 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; 220 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_;
241 221
242 base::ObserverList<ash::CustodianInfoTrayObserver> 222 base::ObserverList<ash::CustodianInfoTrayObserver>
243 custodian_info_changed_observers_; 223 custodian_info_changed_observers_;
244 224
245 base::WeakPtrFactory<SystemTrayDelegateChromeOS> weak_ptr_factory_;
246
247 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); 225 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS);
248 }; 226 };
249 227
250 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); 228 ash::SystemTrayDelegate* CreateSystemTrayDelegate();
251 229
252 } // namespace chromeos 230 } // namespace chromeos
253 231
254 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ 232 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698