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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc

Issue 155493002: Add key based scrolling on magnified screen for kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/magnifier/magnifier_key_scroller.h"
8 #include "ash/media_delegate.h" 9 #include "ash/media_delegate.h"
9 #include "ash/wm/mru_window_tracker.h" 10 #include "ash/wm/mru_window_tracker.h"
10 #include "ash/wm/window_util.h" 11 #include "ash/wm/window_util.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
13 #include "chrome/browser/accessibility/accessibility_events.h" 14 #include "chrome/browser/accessibility/accessibility_events.h"
15 #include "chrome/browser/app_mode/app_mode_utils.h"
14 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 17 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
16 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 18 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
17 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" 19 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h"
18 #include "chrome/browser/chromeos/display/display_configuration_observer.h" 20 #include "chrome/browser/chromeos/display/display_configuration_observer.h"
19 #include "chrome/browser/chromeos/display/display_preferences.h" 21 #include "chrome/browser/chromeos/display/display_preferences.h"
20 #include "chrome/browser/chromeos/extensions/media_player_api.h" 22 #include "chrome/browser/chromeos/extensions/media_player_api.h"
21 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" 23 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
22 #include "chrome/browser/profiles/profile_manager.h" 24 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/speech/tts_controller.h" 25 #include "chrome/browser/speech/tts_controller.h"
(...skipping 10 matching lines...) Expand all
34 #include "chromeos/dbus/power_manager_client.h" 36 #include "chromeos/dbus/power_manager_client.h"
35 #include "chromeos/ime/input_method_manager.h" 37 #include "chromeos/ime/input_method_manager.h"
36 #include "content/public/browser/notification_service.h" 38 #include "content/public/browser/notification_service.h"
37 #include "content/public/browser/user_metrics.h" 39 #include "content/public/browser/user_metrics.h"
38 #include "grit/generated_resources.h" 40 #include "grit/generated_resources.h"
39 #include "ui/aura/window.h" 41 #include "ui/aura/window.h"
40 #include "ui/base/l10n/l10n_util.h" 42 #include "ui/base/l10n/l10n_util.h"
41 43
42 namespace { 44 namespace {
43 45
44 // This function is used for restoring focus after the user session is started. 46 void InitAfterSessionStart() {
45 // It's needed because some windows can be opened in background while login UI 47 // Restor focus after the user session is started. It's needed
46 // is still active because we currently restore browser windows before login UI 48 // because some windows can be opened in background while login UI
47 // is deleted. 49 // is still active because we currently restore browser windows
48 void RestoreFocus() { 50 // before login UI is deleted.
51 ash::Shell* shell = ash::Shell::GetInstance();
49 ash::MruWindowTracker::WindowList mru_list = 52 ash::MruWindowTracker::WindowList mru_list =
50 ash::Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList(); 53 shell->mru_window_tracker()->BuildMruWindowList();
51 if (!mru_list.empty()) 54 if (!mru_list.empty())
52 mru_list.front()->Focus(); 55 mru_list.front()->Focus();
56
57 // Enable magnifier accelerators as there may be no mouse cursor in
58 // kiosk mode.
59 ash::MagnifierKeyScroller::SetEnabled(chrome::IsRunningInForcedAppMode());
53 } 60 }
54 61
55 class AccessibilityDelegateImpl : public ash::AccessibilityDelegate { 62 class AccessibilityDelegateImpl : public ash::AccessibilityDelegate {
56 public: 63 public:
57 AccessibilityDelegateImpl() {} 64 AccessibilityDelegateImpl() {}
58 virtual ~AccessibilityDelegateImpl() {} 65 virtual ~AccessibilityDelegateImpl() {}
59 66
60 virtual void ToggleHighContrast() OVERRIDE { 67 virtual void ToggleHighContrast() OVERRIDE {
61 DCHECK(chromeos::AccessibilityManager::Get()); 68 DCHECK(chromeos::AccessibilityManager::Get());
62 chromeos::AccessibilityManager::Get()->EnableHighContrast( 69 chromeos::AccessibilityManager::Get()->EnableHighContrast(
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 269 }
263 270
264 void ChromeShellDelegate::Observe(int type, 271 void ChromeShellDelegate::Observe(int type,
265 const content::NotificationSource& source, 272 const content::NotificationSource& source,
266 const content::NotificationDetails& details) { 273 const content::NotificationDetails& details) {
267 switch (type) { 274 switch (type) {
268 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED: 275 case chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED:
269 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); 276 ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
270 break; 277 break;
271 case chrome::NOTIFICATION_SESSION_STARTED: 278 case chrome::NOTIFICATION_SESSION_STARTED:
272 RestoreFocus(); 279 InitAfterSessionStart();
273 ash::Shell::GetInstance()->ShowShelf(); 280 ash::Shell::GetInstance()->ShowShelf();
274 break; 281 break;
275 case chrome::NOTIFICATION_APP_TERMINATING: 282 case chrome::NOTIFICATION_APP_TERMINATING:
276 // Let classes unregister themselves as observers of the 283 // Let classes unregister themselves as observers of the
277 // ash::Shell singleton before the shell is destroyed. 284 // ash::Shell singleton before the shell is destroyed.
278 display_configuration_observer_.reset(); 285 display_configuration_observer_.reset();
279 break; 286 break;
280 default: 287 default:
281 NOTREACHED() << "Unexpected notification " << type; 288 NOTREACHED() << "Unexpected notification " << type;
282 } 289 }
283 } 290 }
284 291
285 void ChromeShellDelegate::PlatformInit() { 292 void ChromeShellDelegate::PlatformInit() {
286 registrar_.Add(this, 293 registrar_.Add(this,
287 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 294 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
288 content::NotificationService::AllSources()); 295 content::NotificationService::AllSources());
289 registrar_.Add(this, 296 registrar_.Add(this,
290 chrome::NOTIFICATION_SESSION_STARTED, 297 chrome::NOTIFICATION_SESSION_STARTED,
291 content::NotificationService::AllSources()); 298 content::NotificationService::AllSources());
292 registrar_.Add(this, 299 registrar_.Add(this,
293 chrome::NOTIFICATION_APP_TERMINATING, 300 chrome::NOTIFICATION_APP_TERMINATING,
294 content::NotificationService::AllSources()); 301 content::NotificationService::AllSources());
295 } 302 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698