diff options
author | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-22 08:15:03 +0000 |
---|---|---|
committer | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-22 08:15:03 +0000 |
commit | 828d9905ce54258be2cfb6703ceb6b03af0eb572 (patch) | |
tree | 5bb2b8b68a2fbc86ed03793d8bc5b01c027dfbfb /chrome/browser/chromeos | |
parent | f047d16cb768fc6ddea21bb12f9a1efcd75c52a1 (diff) | |
download | chromium_src-828d9905ce54258be2cfb6703ceb6b03af0eb572.zip chromium_src-828d9905ce54258be2cfb6703ceb6b03af0eb572.tar.gz chromium_src-828d9905ce54258be2cfb6703ceb6b03af0eb572.tar.bz2 |
Enable the new Files.app's UI by default.
This patch makes the new UI default, by replacing the --file-manager-new-ui flag with the --file-manager-legacy-ui flag. Accordingly, the about flag has been renamed. Along the way, fixes the save/open dialog box for the new UI.
TBR=benwells@chromium.org
TEST=Launch chrome *without* --file-manager-new-ui. Files.app should work with the new UI. Launch with --file-manager-legacy-ui, Files.app should display the old UI. Also check the save dialog.
BUG=226904
Review URL: https://codereview.chromium.org/13835010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/extensions/file_manager/file_manager_util.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_util.cc index fccec47..aabc2f4 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_manager_util.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_util.cc @@ -90,6 +90,7 @@ namespace { // out this file manager for an aftermarket part, but not yet. const char kFileBrowserExtensionUrl[] = FILEBROWSER_URL(""); const char kBaseFileBrowserUrl[] = FILEBROWSER_URL("main.html"); +const char kBaseFileBrowserNewUIUrl[] = FILEBROWSER_URL("main_new_ui.html"); const char kMediaPlayerUrl[] = FILEBROWSER_URL("mediaplayer.html"); const char kVideoPlayerUrl[] = FILEBROWSER_URL("video_player.html"); const char kActionChoiceUrl[] = FILEBROWSER_URL("action_choice.html"); @@ -337,6 +338,11 @@ bool IsFileManagerPackaged() { return !command_line->HasSwitch(switches::kFileManagerLegacy); } +bool IsFileManagerNewUI() { + const CommandLine* command_line = CommandLine::ForCurrentProcess(); + return !command_line->HasSwitch(switches::kFileManagerLegacyUI); +} + // Grants file system access to the file browser. bool GrantFileSystemAccessToFileBrowser(Profile* profile) { // File browser always runs in the site for its extension id, so that is the @@ -348,8 +354,7 @@ bool GrantFileSystemAccessToFileBrowser(Profile* profile) { GetFileSystemContext()->external_provider(); if (!external_provider) return false; - GURL url(kBaseFileBrowserUrl); - external_provider->GrantFullAccessToExtension(url.host()); + external_provider->GrantFullAccessToExtension(GetFileBrowserUrl().host()); return true; } @@ -370,7 +375,7 @@ void ExecuteHandler(Profile* profile, GetFileSystemContext(); // We are executing the task on behalf of File Browser extension. - const GURL source_url(kBaseFileBrowserUrl); + const GURL source_url = GetFileBrowserUrl(); std::vector<FileSystemURL> urls; urls.push_back(file_system_context->CrackURL(url)); scoped_refptr<FileTaskExecutor> executor = FileTaskExecutor::Create(profile, @@ -586,7 +591,8 @@ GURL GetFileBrowserExtensionUrl() { } GURL GetFileBrowserUrl() { - return GURL(kBaseFileBrowserUrl); + return GURL(IsFileManagerNewUI() ? kBaseFileBrowserNewUIUrl : + kBaseFileBrowserUrl); } GURL GetMediaPlayerUrl() { |