| 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 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 37 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 38 #include "chrome/browser/chromeos/system/input_device_settings.h" | 38 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 39 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" | 39 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
| 40 #include "chrome/browser/lifetime/application_lifetime.h" | 40 #include "chrome/browser/lifetime/application_lifetime.h" |
| 41 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
| 42 #include "chrome/browser/profiles/profile_manager.h" | 42 #include "chrome/browser/profiles/profile_manager.h" |
| 43 #include "chrome/browser/profiles/profiles_state.h" | 43 #include "chrome/browser/profiles/profiles_state.h" |
| 44 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" | 44 #include "chrome/browser/signin/signin_error_notifier_factory_ash.h" |
| 45 #include "chrome/browser/speech/tts_controller.h" | 45 #include "chrome/browser/speech/tts_controller.h" |
| 46 #include "chrome/browser/sync/sync_error_notifier_factory_ash.h" | 46 #include "chrome/browser/sync/sync_error_notifier_factory_ash.h" |
| 47 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" | |
| 48 #include "chrome/browser/ui/ash/app_list/app_list_service_ash.h" | |
| 49 #include "chrome/browser/ui/ash/chrome_keyboard_ui.h" | 47 #include "chrome/browser/ui/ash/chrome_keyboard_ui.h" |
| 50 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 48 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 51 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" | 49 #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" |
| 52 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 50 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 53 #include "chrome/browser/ui/ash/palette_delegate_chromeos.h" | 51 #include "chrome/browser/ui/ash/palette_delegate_chromeos.h" |
| 54 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" | 52 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" |
| 55 #include "chrome/browser/ui/ash/session_util.h" | 53 #include "chrome/browser/ui/ash/session_util.h" |
| 56 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" | 54 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
| 57 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 55 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
| 58 #include "chrome/browser/ui/browser.h" | 56 #include "chrome/browser/ui/browser.h" |
| 59 #include "chrome/browser/ui/browser_commands.h" | 57 #include "chrome/browser/ui/browser_commands.h" |
| 60 #include "chrome/browser/ui/browser_finder.h" | 58 #include "chrome/browser/ui/browser_finder.h" |
| 61 #include "chrome/browser/ui/browser_navigator.h" | 59 #include "chrome/browser/ui/browser_navigator.h" |
| 62 #include "chrome/browser/ui/browser_navigator_params.h" | 60 #include "chrome/browser/ui/browser_navigator_params.h" |
| 63 #include "chrome/browser/ui/browser_tabstrip.h" | 61 #include "chrome/browser/ui/browser_tabstrip.h" |
| 64 #include "chrome/browser/ui/browser_window.h" | 62 #include "chrome/browser/ui/browser_window.h" |
| 65 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 63 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 66 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 67 #include "chrome/grit/chromium_strings.h" | 65 #include "chrome/grit/chromium_strings.h" |
| 68 #include "chrome/grit/generated_resources.h" | 66 #include "chrome/grit/generated_resources.h" |
| 69 #include "chrome/grit/theme_resources.h" | 67 #include "chrome/grit/theme_resources.h" |
| 70 #include "chromeos/chromeos_switches.h" | 68 #include "chromeos/chromeos_switches.h" |
| 71 #include "components/prefs/pref_service.h" | 69 #include "components/prefs/pref_service.h" |
| 72 #include "components/user_manager/user.h" | 70 #include "components/user_manager/user.h" |
| 73 #include "components/user_manager/user_manager.h" | 71 #include "components/user_manager/user_manager.h" |
| 74 #include "content/public/browser/notification_service.h" | 72 #include "content/public/browser/notification_service.h" |
| 75 #include "content/public/browser/user_metrics.h" | 73 #include "content/public/browser/user_metrics.h" |
| 76 #include "content/public/common/service_manager_connection.h" | 74 #include "content/public/common/service_manager_connection.h" |
| 77 #include "ui/app_list/presenter/app_list_presenter.h" | |
| 78 #include "ui/aura/window.h" | 75 #include "ui/aura/window.h" |
| 79 #include "ui/base/ime/chromeos/input_method_manager.h" | 76 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 80 #include "ui/base/l10n/l10n_util.h" | 77 #include "ui/base/l10n/l10n_util.h" |
| 81 #include "ui/base/resource/resource_bundle.h" | 78 #include "ui/base/resource/resource_bundle.h" |
| 82 | 79 |
| 83 using chromeos::AccessibilityManager; | 80 using chromeos::AccessibilityManager; |
| 84 | 81 |
| 85 namespace { | 82 namespace { |
| 86 | 83 |
| 87 const char kKeyboardShortcutHelpPageUrl[] = | 84 const char kKeyboardShortcutHelpPageUrl[] = |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 displayer.browser(), url_to_open, | 443 displayer.browser(), url_to_open, |
| 447 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK | | 444 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK | |
| 448 ui::PAGE_TRANSITION_FROM_API)); | 445 ui::PAGE_TRANSITION_FROM_API)); |
| 449 | 446 |
| 450 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 447 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
| 451 // browser will be shown on the active desktop, we ensure the visibility. | 448 // browser will be shown on the active desktop, we ensure the visibility. |
| 452 multi_user_util::MoveWindowToCurrentDesktop( | 449 multi_user_util::MoveWindowToCurrentDesktop( |
| 453 displayer.browser()->window()->GetNativeWindow()); | 450 displayer.browser()->window()->GetNativeWindow()); |
| 454 } | 451 } |
| 455 | 452 |
| 456 app_list::AppListPresenter* ChromeShellDelegate::GetAppListPresenter() { | |
| 457 DCHECK(ash::Shell::HasInstance()); | |
| 458 return AppListServiceAsh::GetInstance()->GetAppListPresenter(); | |
| 459 } | |
| 460 | |
| 461 ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate( | 453 ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate( |
| 462 ash::ShelfModel* model) { | 454 ash::ShelfModel* model) { |
| 463 if (!shelf_delegate_) { | 455 if (!shelf_delegate_) { |
| 464 shelf_delegate_ = new ChromeLauncherControllerImpl(nullptr, model); | 456 shelf_delegate_ = new ChromeLauncherControllerImpl(nullptr, model); |
| 465 shelf_delegate_->Init(); | 457 shelf_delegate_->Init(); |
| 466 } | 458 } |
| 467 return shelf_delegate_; | 459 return shelf_delegate_; |
| 468 } | 460 } |
| 469 | 461 |
| 470 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( | 462 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 NOTREACHED() << "Unexpected notification " << type; | 577 NOTREACHED() << "Unexpected notification " << type; |
| 586 } | 578 } |
| 587 } | 579 } |
| 588 | 580 |
| 589 void ChromeShellDelegate::PlatformInit() { | 581 void ChromeShellDelegate::PlatformInit() { |
| 590 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 582 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 591 content::NotificationService::AllSources()); | 583 content::NotificationService::AllSources()); |
| 592 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 584 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 593 content::NotificationService::AllSources()); | 585 content::NotificationService::AllSources()); |
| 594 } | 586 } |
| OLD | NEW |