Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2184)

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 7941014: Use extension-based file picker from CrOS for Aura builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux_touchui Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/file_manager_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index 17f978c7fa66c5ae8f0e4a29750d27d9892ef39a..8b6ba9ebbf9f32f2de9098dbb95ee5c543dc60d7 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -156,6 +156,28 @@ enum ContextType {
kMediaContext
};
+typedef std::list<std::pair<FilePath::StringType, int> >
+ ComponentExtensionList;
+
+#if defined(FILE_MANAGER_EXTENSION)
+void AddFileManagerExtension(ComponentExtensionList* component_extensions) {
+#ifndef NDEBUG
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) {
+ FilePath filemgr_extension_path =
+ command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath);
+ component_extensions->push_back(std::make_pair(
+ filemgr_extension_path.value(),
+ IDR_FILEMANAGER_MANIFEST));
+ return;
+ }
+#endif // NDEBUG
+ component_extensions->push_back(std::make_pair(
+ FILE_PATH_LITERAL("file_manager"),
+ IDR_FILEMANAGER_MANIFEST));
+}
+#endif // defined(FILE_MANAGER_EXTENSION)
+
// Gets the cache parameters from the command line. |type| is the type of
// request context that we need, |cache_path| will be set to the user provided
// path, or will not be touched if there is not an argument. |max_size| will
@@ -611,24 +633,7 @@ void ProfileImpl::RegisterComponentExtensions() {
IDR_BOOKMARKS_MANIFEST));
#if defined(FILE_MANAGER_EXTENSION)
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
-#ifndef NDEBUG
- if (command_line->HasSwitch(switches::kFileManagerExtensionPath)) {
- FilePath filemgr_extension_path =
- command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath);
- component_extensions.push_back(std::make_pair(
- filemgr_extension_path.value(),
- IDR_FILEMANAGER_MANIFEST));
- } else {
- component_extensions.push_back(std::make_pair(
- FILE_PATH_LITERAL("file_manager"),
- IDR_FILEMANAGER_MANIFEST));
- }
-#else
- component_extensions.push_back(std::make_pair(
- FILE_PATH_LITERAL("file_manager"),
- IDR_FILEMANAGER_MANIFEST));
-#endif
+ AddFileManagerExtension(&component_extensions);
#endif
#if defined(TOUCH_UI)
@@ -642,6 +647,7 @@ void ProfileImpl::RegisterComponentExtensions() {
FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"),
IDR_MOBILE_MANIFEST));
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kAuthExtensionPath)) {
FilePath auth_extension_path =
command_line->GetSwitchValuePath(switches::kAuthExtensionPath);
« no previous file with comments | « chrome/browser/extensions/file_manager_util.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698