| Index: chrome/browser/ui/ash/chrome_new_window_delegate.cc
|
| diff --git a/chrome/browser/ui/ash/chrome_new_window_delegate.cc b/chrome/browser/ui/ash/chrome_new_window_delegate.cc
|
| index dd08fa5844bb3d06bd8a9ca8d654d4de1ac097c8..68ac5dfeab0a1085f796a1a58dc1c0fc9e7301f2 100644
|
| --- a/chrome/browser/ui/ash/chrome_new_window_delegate.cc
|
| +++ b/chrome/browser/ui/ash/chrome_new_window_delegate.cc
|
| @@ -4,8 +4,13 @@
|
|
|
| #include "chrome/browser/ui/ash/chrome_new_window_delegate.h"
|
|
|
| +#include "ash/content/keyboard_overlay/keyboard_overlay_view.h"
|
| #include "ash/wm/window_util.h"
|
| #include "base/macros.h"
|
| +#include "chrome/browser/chromeos/file_manager/app_id.h"
|
| +#include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/browser/extensions/extension_util.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/sessions/tab_restore_service_factory.h"
|
| #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
|
| @@ -13,9 +18,18 @@
|
| #include "chrome/browser/ui/browser_commands.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/browser/ui/browser_window.h"
|
| +#include "chrome/browser/ui/chrome_pages.h"
|
| +#include "chrome/browser/ui/extensions/app_launch_params.h"
|
| +#include "chrome/browser/ui/extensions/application_launch.h"
|
| #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
|
| +#include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
|
| +#include "chrome/common/url_constants.h"
|
| #include "components/sessions/core/tab_restore_service.h"
|
| #include "components/sessions/core/tab_restore_service_observer.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +#include "extensions/browser/extension_system.h"
|
| +#include "extensions/common/constants.h"
|
| +#include "ui/base/window_open_disposition.h"
|
|
|
| namespace {
|
|
|
| @@ -105,6 +119,44 @@ void ChromeNewWindowDelegate::NewWindow(bool is_incognito) {
|
| : profile);
|
| }
|
|
|
| +void ChromeNewWindowDelegate::OpenFileManager() {
|
| + using file_manager::kFileManagerAppId;
|
| + Profile* const profile = ProfileManager::GetActiveUserProfile();
|
| + const ExtensionService* const service =
|
| + extensions::ExtensionSystem::Get(profile)->extension_service();
|
| + if (!service ||
|
| + !extensions::util::IsAppLaunchableWithoutEnabling(kFileManagerAppId,
|
| + profile)) {
|
| + return;
|
| + }
|
| +
|
| + const extensions::Extension* const extension =
|
| + service->GetInstalledExtension(kFileManagerAppId);
|
| + OpenApplication(CreateAppLaunchParamsUserContainer(
|
| + profile, extension, NEW_FOREGROUND_TAB, extensions::SOURCE_KEYBOARD));
|
| +}
|
| +
|
| +void ChromeNewWindowDelegate::OpenCrosh() {
|
| + Profile* profile = ProfileManager::GetActiveUserProfile();
|
| + GURL crosh_url =
|
| + extensions::TerminalExtensionHelper::GetCroshExtensionURL(profile);
|
| + if (!crosh_url.is_valid())
|
| + return;
|
| + chrome::ScopedTabbedBrowserDisplayer displayer(profile);
|
| + Browser* browser = displayer.browser();
|
| + content::WebContents* page = browser->OpenURL(
|
| + content::OpenURLParams(crosh_url, content::Referrer(), NEW_FOREGROUND_TAB,
|
| + ui::PAGE_TRANSITION_GENERATED, false));
|
| + browser->window()->Show();
|
| + browser->window()->Activate();
|
| + page->Focus();
|
| +}
|
| +
|
| +void ChromeNewWindowDelegate::OpenGetHelp() {
|
| + Profile* const profile = ProfileManager::GetActiveUserProfile();
|
| + chrome::ShowHelpForProfile(profile, chrome::HELP_SOURCE_KEYBOARD);
|
| +}
|
| +
|
| void ChromeNewWindowDelegate::RestoreTab() {
|
| if (tab_restore_helper_.get()) {
|
| DCHECK(!tab_restore_helper_->tab_restore_service()->IsLoaded());
|
| @@ -130,6 +182,14 @@ void ChromeNewWindowDelegate::RestoreTab() {
|
| }
|
| }
|
|
|
| +void ChromeNewWindowDelegate::ShowKeyboardOverlay() {
|
| + // TODO(mazda): Move the show logic to ash (http://crbug.com/124222).
|
| + Profile* profile = ProfileManager::GetActiveUserProfile();
|
| + std::string url(chrome::kChromeUIKeyboardOverlayURL);
|
| + ash::KeyboardOverlayView::ShowDialog(profile, new ChromeWebContentsHandler,
|
| + GURL(url));
|
| +}
|
| +
|
| void ChromeNewWindowDelegate::ShowTaskManager() {
|
| chrome::OpenTaskManager(NULL);
|
| }
|
|
|