| 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 <limits> | 9 #include <limits> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 53 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 54 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 54 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
| 55 #include "chrome/browser/ui/browser.h" | 55 #include "chrome/browser/ui/browser.h" |
| 56 #include "chrome/browser/ui/browser_commands.h" | 56 #include "chrome/browser/ui/browser_commands.h" |
| 57 #include "chrome/browser/ui/browser_finder.h" | 57 #include "chrome/browser/ui/browser_finder.h" |
| 58 #include "chrome/browser/ui/browser_navigator.h" | 58 #include "chrome/browser/ui/browser_navigator.h" |
| 59 #include "chrome/browser/ui/browser_navigator_params.h" | 59 #include "chrome/browser/ui/browser_navigator_params.h" |
| 60 #include "chrome/browser/ui/browser_tabstrip.h" | 60 #include "chrome/browser/ui/browser_tabstrip.h" |
| 61 #include "chrome/browser/ui/browser_window.h" | 61 #include "chrome/browser/ui/browser_window.h" |
| 62 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 62 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 63 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "chrome/grit/chromium_strings.h" | 65 #include "chrome/grit/chromium_strings.h" |
| 65 #include "chrome/grit/generated_resources.h" | 66 #include "chrome/grit/generated_resources.h" |
| 66 #include "chrome/grit/theme_resources.h" | 67 #include "chrome/grit/theme_resources.h" |
| 67 #include "chromeos/chromeos_switches.h" | 68 #include "chromeos/chromeos_switches.h" |
| 68 #include "components/prefs/pref_service.h" | 69 #include "components/prefs/pref_service.h" |
| 69 #include "components/user_manager/user.h" | 70 #include "components/user_manager/user.h" |
| 70 #include "components/user_manager/user_manager.h" | 71 #include "components/user_manager/user_manager.h" |
| 72 #include "content/public/browser/media_session.h" |
| 71 #include "content/public/browser/notification_service.h" | 73 #include "content/public/browser/notification_service.h" |
| 72 #include "content/public/common/service_manager_connection.h" | 74 #include "content/public/common/service_manager_connection.h" |
| 73 #include "ui/aura/window.h" | 75 #include "ui/aura/window.h" |
| 74 #include "ui/base/ime/chromeos/input_method_manager.h" | 76 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 75 #include "ui/base/l10n/l10n_util.h" | 77 #include "ui/base/l10n/l10n_util.h" |
| 76 #include "ui/base/resource/resource_bundle.h" | 78 #include "ui/base/resource/resource_bundle.h" |
| 77 | 79 |
| 78 using chromeos::AccessibilityManager; | 80 using chromeos::AccessibilityManager; |
| 79 | 81 |
| 80 namespace { | 82 namespace { |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 583 |
| 582 void ChromeShellDelegate::UpdateTouchscreenStatusFromPrefs() { | 584 void ChromeShellDelegate::UpdateTouchscreenStatusFromPrefs() { |
| 583 chromeos::system::InputDeviceSettings::Get() | 585 chromeos::system::InputDeviceSettings::Get() |
| 584 ->UpdateTouchscreenStatusFromPrefs(); | 586 ->UpdateTouchscreenStatusFromPrefs(); |
| 585 } | 587 } |
| 586 | 588 |
| 587 void ChromeShellDelegate::ToggleTouchpad() { | 589 void ChromeShellDelegate::ToggleTouchpad() { |
| 588 chromeos::system::InputDeviceSettings::Get()->ToggleTouchpad(); | 590 chromeos::system::InputDeviceSettings::Get()->ToggleTouchpad(); |
| 589 } | 591 } |
| 590 | 592 |
| 593 void ChromeShellDelegate::SuspendMediaSessions() { |
| 594 for (TabContentsIterator it; !it.done(); it.Next()) { |
| 595 content::MediaSession::Get(*it)->Suspend( |
| 596 content::MediaSession::SuspendType::SYSTEM); |
| 597 } |
| 598 } |
| 599 |
| 591 keyboard::KeyboardUI* ChromeShellDelegate::CreateKeyboardUI() { | 600 keyboard::KeyboardUI* ChromeShellDelegate::CreateKeyboardUI() { |
| 592 return new ChromeKeyboardUI(ProfileManager::GetActiveUserProfile()); | 601 return new ChromeKeyboardUI(ProfileManager::GetActiveUserProfile()); |
| 593 } | 602 } |
| 594 | 603 |
| 595 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { | 604 ash::AccessibilityDelegate* ChromeShellDelegate::CreateAccessibilityDelegate() { |
| 596 return new AccessibilityDelegateImpl; | 605 return new AccessibilityDelegateImpl; |
| 597 } | 606 } |
| 598 | 607 |
| 599 std::unique_ptr<ash::PaletteDelegate> | 608 std::unique_ptr<ash::PaletteDelegate> |
| 600 ChromeShellDelegate::CreatePaletteDelegate() { | 609 ChromeShellDelegate::CreatePaletteDelegate() { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 NOTREACHED() << "Unexpected notification " << type; | 648 NOTREACHED() << "Unexpected notification " << type; |
| 640 } | 649 } |
| 641 } | 650 } |
| 642 | 651 |
| 643 void ChromeShellDelegate::PlatformInit() { | 652 void ChromeShellDelegate::PlatformInit() { |
| 644 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 653 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 645 content::NotificationService::AllSources()); | 654 content::NotificationService::AllSources()); |
| 646 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 655 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 647 content::NotificationService::AllSources()); | 656 content::NotificationService::AllSources()); |
| 648 } | 657 } |
| OLD | NEW |