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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 2661283002: cros: Clean up SessionStateDelegate refs in Chrome (Closed)
Patch Set: update browser_finder_chromeos_unittest 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <utility> 11 #include <utility>
12 12
13 #include "ash/autoclick/autoclick_controller.h" 13 #include "ash/autoclick/autoclick_controller.h"
14 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h" 14 #include "ash/autoclick/mus/public/interfaces/autoclick.mojom.h"
15 #include "ash/common/ash_constants.h" 15 #include "ash/common/ash_constants.h"
16 #include "ash/common/session/session_state_delegate.h"
17 #include "ash/common/shelf/shelf_layout_manager.h" 16 #include "ash/common/shelf/shelf_layout_manager.h"
18 #include "ash/common/shelf/wm_shelf.h" 17 #include "ash/common/shelf/wm_shelf.h"
19 #include "ash/common/wm_shell.h" 18 #include "ash/common/wm_shell.h"
20 #include "ash/common/wm_window.h" 19 #include "ash/common/wm_window.h"
21 #include "ash/high_contrast/high_contrast_controller.h" 20 #include "ash/high_contrast/high_contrast_controller.h"
22 #include "ash/root_window_controller.h" 21 #include "ash/root_window_controller.h"
23 #include "ash/shell.h" 22 #include "ash/shell.h"
24 #include "ash/sticky_keys/sticky_keys_controller.h" 23 #include "ash/sticky_keys/sticky_keys_controller.h"
25 #include "base/callback.h" 24 #include "base/callback.h"
26 #include "base/callback_helpers.h" 25 #include "base/callback_helpers.h"
(...skipping 24 matching lines...) Expand all
51 #include "chrome/browser/profiles/profile.h" 50 #include "chrome/browser/profiles/profile.h"
52 #include "chrome/browser/profiles/profile_manager.h" 51 #include "chrome/browser/profiles/profile_manager.h"
53 #include "chrome/browser/ui/ash/ash_util.h" 52 #include "chrome/browser/ui/ash/ash_util.h"
54 #include "chrome/common/chrome_paths.h" 53 #include "chrome/common/chrome_paths.h"
55 #include "chrome/common/extensions/api/accessibility_private.h" 54 #include "chrome/common/extensions/api/accessibility_private.h"
56 #include "chrome/common/extensions/extension_constants.h" 55 #include "chrome/common/extensions/extension_constants.h"
57 #include "chrome/common/pref_names.h" 56 #include "chrome/common/pref_names.h"
58 #include "chrome/grit/browser_resources.h" 57 #include "chrome/grit/browser_resources.h"
59 #include "chromeos/audio/audio_a11y_controller.h" 58 #include "chromeos/audio/audio_a11y_controller.h"
60 #include "chromeos/audio/chromeos_sounds.h" 59 #include "chromeos/audio/chromeos_sounds.h"
61 #include "chromeos/login/login_state.h"
62 #include "components/prefs/pref_member.h" 60 #include "components/prefs/pref_member.h"
63 #include "components/prefs/pref_service.h" 61 #include "components/prefs/pref_service.h"
64 #include "components/user_manager/user_manager.h"
65 #include "content/public/browser/browser_accessibility_state.h" 62 #include "content/public/browser/browser_accessibility_state.h"
66 #include "content/public/browser/browser_thread.h" 63 #include "content/public/browser/browser_thread.h"
67 #include "content/public/browser/notification_details.h" 64 #include "content/public/browser/notification_details.h"
68 #include "content/public/browser/notification_service.h" 65 #include "content/public/browser/notification_service.h"
69 #include "content/public/browser/notification_source.h" 66 #include "content/public/browser/notification_source.h"
70 #include "content/public/browser/web_ui.h" 67 #include "content/public/browser/web_ui.h"
71 #include "content/public/common/content_switches.h" 68 #include "content/public/common/content_switches.h"
72 #include "content/public/common/service_manager_connection.h" 69 #include "content/public/common/service_manager_connection.h"
73 #include "extensions/browser/event_router.h" 70 #include "extensions/browser/event_router.h"
74 #include "extensions/browser/extension_registry.h" 71 #include "extensions/browser/extension_registry.h"
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 UpdateFocusHighlightFromPref(); 1142 UpdateFocusHighlightFromPref();
1146 UpdateSelectToSpeakFromPref(); 1143 UpdateSelectToSpeakFromPref();
1147 UpdateSwitchAccessFromPref(); 1144 UpdateSwitchAccessFromPref();
1148 1145
1149 // Update the panel height in the shelf layout manager when the profile 1146 // Update the panel height in the shelf layout manager when the profile
1150 // changes, since the shelf layout manager doesn't exist in the login profile. 1147 // changes, since the shelf layout manager doesn't exist in the login profile.
1151 if (chromevox_panel_) 1148 if (chromevox_panel_)
1152 chromevox_panel_->UpdatePanelHeight(); 1149 chromevox_panel_->UpdatePanelHeight();
1153 } 1150 }
1154 1151
1155 void AccessibilityManager::ActiveUserChanged(const AccountId& account_id) { 1152 void AccessibilityManager::ActiveUserChanged(
1153 const user_manager::User* active_user) {
1156 SetProfile(ProfileManager::GetActiveUserProfile()); 1154 SetProfile(ProfileManager::GetActiveUserProfile());
1157 } 1155 }
1158 1156
1159 void AccessibilityManager::OnAppTerminating() {
1160 session_state_observer_.reset();
1161 }
1162
1163 void AccessibilityManager::OnFullscreenStateChanged( 1157 void AccessibilityManager::OnFullscreenStateChanged(
1164 bool is_fullscreen, 1158 bool is_fullscreen,
1165 ash::WmWindow* root_window) { 1159 ash::WmWindow* root_window) {
1166 if (chromevox_panel_) 1160 if (chromevox_panel_)
1167 chromevox_panel_->UpdateWidgetBounds(); 1161 chromevox_panel_->UpdateWidgetBounds();
1168 } 1162 }
1169 1163
1170 void AccessibilityManager::SetProfileForTest(Profile* profile) { 1164 void AccessibilityManager::SetProfileForTest(Profile* profile) {
1171 SetProfile(profile); 1165 SetProfile(profile);
1172 } 1166 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 Profile* profile = ProfileManager::GetActiveUserProfile(); 1255 Profile* profile = ProfileManager::GetActiveUserProfile();
1262 if (ProfileHelper::IsSigninProfile(profile)) 1256 if (ProfileHelper::IsSigninProfile(profile))
1263 SetProfile(profile); 1257 SetProfile(profile);
1264 break; 1258 break;
1265 } 1259 }
1266 case chrome::NOTIFICATION_SESSION_STARTED: 1260 case chrome::NOTIFICATION_SESSION_STARTED:
1267 // Update |profile_| when entering a session. 1261 // Update |profile_| when entering a session.
1268 SetProfile(ProfileManager::GetActiveUserProfile()); 1262 SetProfile(ProfileManager::GetActiveUserProfile());
1269 1263
1270 // Add a session state observer to be able to monitor session changes. 1264 // Add a session state observer to be able to monitor session changes.
1271 if (!session_state_observer_.get() && ash::Shell::HasInstance()) 1265 if (!session_state_observer_.get())
1272 session_state_observer_.reset( 1266 session_state_observer_.reset(
1273 new ash::ScopedSessionStateObserver(this)); 1267 new user_manager::ScopedUserSessionStateObserver(this));
1274 break; 1268 break;
1275 case chrome::NOTIFICATION_PROFILE_DESTROYED: { 1269 case chrome::NOTIFICATION_PROFILE_DESTROYED: {
1276 // Update |profile_| when exiting a session or shutting down. 1270 // Update |profile_| when exiting a session or shutting down.
1277 Profile* profile = content::Source<Profile>(source).ptr(); 1271 Profile* profile = content::Source<Profile>(source).ptr();
1278 if (profile_ == profile) 1272 if (profile_ == profile)
1279 SetProfile(NULL); 1273 SetProfile(NULL);
1280 break; 1274 break;
1281 } 1275 }
1282 } 1276 }
1283 } 1277 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 content::BrowserContext* context) { 1394 content::BrowserContext* context) {
1401 keyboard_listener_extension_id_ = id; 1395 keyboard_listener_extension_id_ = id;
1402 1396
1403 extensions::ExtensionRegistry* registry = 1397 extensions::ExtensionRegistry* registry =
1404 extensions::ExtensionRegistry::Get(context); 1398 extensions::ExtensionRegistry::Get(context);
1405 if (!extension_registry_observer_.IsObserving(registry) && !id.empty()) 1399 if (!extension_registry_observer_.IsObserving(registry) && !id.empty())
1406 extension_registry_observer_.Add(registry); 1400 extension_registry_observer_.Add(registry);
1407 } 1401 }
1408 1402
1409 } // namespace chromeos 1403 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698