| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ash/accelerators/magnifier_key_scroller.h" | 9 #include "ash/accelerators/magnifier_key_scroller.h" |
| 10 #include "ash/accelerators/spoken_feedback_toggler.h" | 10 #include "ash/accelerators/spoken_feedback_toggler.h" |
| 11 #include "ash/aura/wm_window_aura.h" | 11 #include "ash/aura/wm_window_aura.h" |
| 12 #include "ash/common/accessibility_delegate.h" | 12 #include "ash/common/accessibility_delegate.h" |
| 13 #include "ash/common/session/session_state_delegate.h" | 13 #include "ash/common/session/session_state_delegate.h" |
| 14 #include "ash/common/wm/mru_window_tracker.h" | 14 #include "ash/common/wm/mru_window_tracker.h" |
| 15 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
| 16 #include "ash/common/wm_shell.h" | 16 #include "ash/common/wm_shell.h" |
| 17 #include "ash/container_delegate_aura.h" | 17 #include "ash/container_delegate_aura.h" |
| 18 #include "ash/content/gpu_support_impl.h" | 18 #include "ash/content/gpu_support_impl.h" |
| 19 #include "ash/pointer_watcher_delegate_aura.h" | 19 #include "ash/pointer_watcher_delegate_aura.h" |
| 20 #include "ash/shell.h" |
| 20 #include "ash/wm/window_util.h" | 21 #include "ash/wm/window_util.h" |
| 21 #include "base/command_line.h" | 22 #include "base/command_line.h" |
| 22 #include "base/macros.h" | 23 #include "base/macros.h" |
| 23 #include "base/memory/ptr_util.h" | 24 #include "base/memory/ptr_util.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 25 #include "chrome/browser/app_mode/app_mode_utils.h" | 26 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 26 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
| 27 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 28 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 28 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 29 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" | 30 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 } | 353 } |
| 353 | 354 |
| 354 bool ChromeShellDelegate::IsIncognitoAllowed() const { | 355 bool ChromeShellDelegate::IsIncognitoAllowed() const { |
| 355 return chromeos::AccessibilityManager::Get()->IsIncognitoAllowed(); | 356 return chromeos::AccessibilityManager::Get()->IsIncognitoAllowed(); |
| 356 } | 357 } |
| 357 | 358 |
| 358 bool ChromeShellDelegate::IsRunningInForcedAppMode() const { | 359 bool ChromeShellDelegate::IsRunningInForcedAppMode() const { |
| 359 return chrome::IsRunningInForcedAppMode(); | 360 return chrome::IsRunningInForcedAppMode(); |
| 360 } | 361 } |
| 361 | 362 |
| 362 bool ChromeShellDelegate::CanShowWindowForUser(aura::Window* window) const { | 363 bool ChromeShellDelegate::CanShowWindowForUser(ash::WmWindow* window) const { |
| 363 return ::CanShowWindowForUser(window, base::Bind(&GetActiveBrowserContext)); | 364 return ::CanShowWindowForUser(ash::WmWindowAura::GetAuraWindow(window), |
| 365 base::Bind(&GetActiveBrowserContext)); |
| 364 } | 366 } |
| 365 | 367 |
| 366 bool ChromeShellDelegate::IsForceMaximizeOnFirstRun() const { | 368 bool ChromeShellDelegate::IsForceMaximizeOnFirstRun() const { |
| 367 const user_manager::User* const user = | 369 const user_manager::User* const user = |
| 368 user_manager::UserManager::Get()->GetActiveUser(); | 370 user_manager::UserManager::Get()->GetActiveUser(); |
| 369 if (user) { | 371 if (user) { |
| 370 return chromeos::ProfileHelper::Get() | 372 return chromeos::ProfileHelper::Get() |
| 371 ->GetProfileByUser(user) | 373 ->GetProfileByUser(user) |
| 372 ->GetPrefs() | 374 ->GetPrefs() |
| 373 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); | 375 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 NOTREACHED() << "Unexpected notification " << type; | 563 NOTREACHED() << "Unexpected notification " << type; |
| 562 } | 564 } |
| 563 } | 565 } |
| 564 | 566 |
| 565 void ChromeShellDelegate::PlatformInit() { | 567 void ChromeShellDelegate::PlatformInit() { |
| 566 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 568 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 567 content::NotificationService::AllSources()); | 569 content::NotificationService::AllSources()); |
| 568 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 570 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 569 content::NotificationService::AllSources()); | 571 content::NotificationService::AllSources()); |
| 570 } | 572 } |
| OLD | NEW |