OLD | NEW |
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/accessibility_types.h" | 14 #include "ash/accessibility_types.h" |
15 #include "ash/system/tray/system_tray_delegate.h" | 15 #include "ash/system/tray/system_tray_delegate.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser_list_observer.h" | 20 #include "chrome/browser/ui/browser_list_observer.h" |
21 #include "components/prefs/pref_change_registrar.h" | 21 #include "components/prefs/pref_change_registrar.h" |
22 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
23 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
24 #include "extensions/browser/app_window/app_window_registry.h" | 24 #include "extensions/browser/app_window/app_window_registry.h" |
25 #include "ui/base/ime/chromeos/ime_keyboard.h" | 25 #include "ui/base/ime/chromeos/ime_keyboard.h" |
26 #include "ui/base/ime/chromeos/input_method_manager.h" | |
27 #include "ui/chromeos/ime/input_method_menu_manager.h" | |
28 | 26 |
29 namespace ash { | 27 namespace ash { |
30 class SystemTrayNotifier; | 28 class SystemTrayNotifier; |
31 } | 29 } |
32 | 30 |
33 namespace chromeos { | 31 namespace chromeos { |
34 | 32 |
35 // TODO(jamescook): Move observation of IME state into ash. | |
36 class SystemTrayDelegateChromeOS | 33 class SystemTrayDelegateChromeOS |
37 : public ui::ime::InputMethodMenuManager::Observer, | 34 : public ash::SystemTrayDelegate, |
38 public ash::SystemTrayDelegate, | |
39 public content::NotificationObserver, | 35 public content::NotificationObserver, |
40 public input_method::InputMethodManager::Observer, | |
41 public chrome::BrowserListObserver, | 36 public chrome::BrowserListObserver, |
42 public extensions::AppWindowRegistry::Observer, | 37 public extensions::AppWindowRegistry::Observer { |
43 public input_method::InputMethodManager::ImeMenuObserver { | |
44 public: | 38 public: |
45 SystemTrayDelegateChromeOS(); | 39 SystemTrayDelegateChromeOS(); |
46 ~SystemTrayDelegateChromeOS() override; | 40 ~SystemTrayDelegateChromeOS() override; |
47 | 41 |
48 // Overridden from ash::SystemTrayDelegate: | 42 // Overridden from ash::SystemTrayDelegate: |
49 void Initialize() override; | 43 void Initialize() override; |
50 void ShowUserLogin() override; | 44 void ShowUserLogin() override; |
51 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; | 45 ash::NetworkingConfigDelegate* GetNetworkingConfigDelegate() const override; |
52 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; | 46 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; |
53 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; | 47 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; |
(...skipping 26 matching lines...) Expand all Loading... |
80 const content::NotificationSource& source, | 74 const content::NotificationSource& source, |
81 const content::NotificationDetails& details) override; | 75 const content::NotificationDetails& details) override; |
82 | 76 |
83 void OnLanguageRemapSearchKeyToChanged(); | 77 void OnLanguageRemapSearchKeyToChanged(); |
84 | 78 |
85 void OnAccessibilityModeChanged( | 79 void OnAccessibilityModeChanged( |
86 ash::AccessibilityNotificationVisibility notify); | 80 ash::AccessibilityNotificationVisibility notify); |
87 | 81 |
88 void UpdatePerformanceTracing(); | 82 void UpdatePerformanceTracing(); |
89 | 83 |
90 // Overridden from InputMethodManager::Observer. | |
91 void InputMethodChanged(input_method::InputMethodManager* manager, | |
92 Profile* profile, | |
93 bool show_message) override; | |
94 | |
95 // Overridden from InputMethodMenuManager::Observer. | |
96 void InputMethodMenuItemChanged( | |
97 ui::ime::InputMethodMenuManager* manager) override; | |
98 | |
99 // Overridden from chrome::BrowserListObserver: | 84 // Overridden from chrome::BrowserListObserver: |
100 void OnBrowserRemoved(Browser* browser) override; | 85 void OnBrowserRemoved(Browser* browser) override; |
101 | 86 |
102 // Overridden from extensions::AppWindowRegistry::Observer: | 87 // Overridden from extensions::AppWindowRegistry::Observer: |
103 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; | 88 void OnAppWindowRemoved(extensions::AppWindow* app_window) override; |
104 | 89 |
105 void OnAccessibilityStatusChanged( | 90 void OnAccessibilityStatusChanged( |
106 const AccessibilityStatusEventDetails& details); | 91 const AccessibilityStatusEventDetails& details); |
107 | 92 |
108 // input_method::InputMethodManager::ImeMenuObserver: | |
109 void ImeMenuActivationChanged(bool is_active) override; | |
110 void ImeMenuListChanged() override; | |
111 void ImeMenuItemsChanged( | |
112 const std::string& engine_id, | |
113 const std::vector<input_method::InputMethodManager::MenuItem>& items) | |
114 override; | |
115 | |
116 std::unique_ptr<content::NotificationRegistrar> registrar_; | 93 std::unique_ptr<content::NotificationRegistrar> registrar_; |
117 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; | 94 std::unique_ptr<PrefChangeRegistrar> local_state_registrar_; |
118 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; | 95 std::unique_ptr<PrefChangeRegistrar> user_pref_registrar_; |
119 Profile* user_profile_ = nullptr; | 96 Profile* user_profile_ = nullptr; |
120 int search_key_mapped_to_ = input_method::kSearchKey; | 97 int search_key_mapped_to_ = input_method::kSearchKey; |
121 bool have_session_start_time_ = false; | 98 bool have_session_start_time_ = false; |
122 base::TimeTicks session_start_time_; | 99 base::TimeTicks session_start_time_; |
123 bool have_session_length_limit_ = false; | 100 bool have_session_length_limit_ = false; |
124 base::TimeDelta session_length_limit_; | 101 base::TimeDelta session_length_limit_; |
125 bool session_started_ = false; | 102 bool session_started_ = false; |
126 | 103 |
127 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_; | 104 std::unique_ptr<ash::NetworkingConfigDelegate> networking_config_delegate_; |
128 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; | 105 std::unique_ptr<AccessibilityStatusSubscription> accessibility_subscription_; |
129 | 106 |
130 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); | 107 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegateChromeOS); |
131 }; | 108 }; |
132 | 109 |
133 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); | 110 ash::SystemTrayDelegate* CreateSystemTrayDelegate(); |
134 | 111 |
135 } // namespace chromeos | 112 } // namespace chromeos |
136 | 113 |
137 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ | 114 #endif // CHROME_BROWSER_UI_ASH_SYSTEM_TRAY_DELEGATE_CHROMEOS_H_ |
OLD | NEW |