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

Side by Side Diff: chrome/browser/extensions/file_manager_util.cc

Issue 9419033: Move creation of BrowserContext objects that live in content to content, instead of depending on th… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fix memory leaks in tests Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/extensions/file_manager_util.h" 4 #include "chrome/browser/extensions/file_manager_util.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 20 matching lines...) Expand all
31 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
32 #include "webkit/fileapi/file_system_context.h" 32 #include "webkit/fileapi/file_system_context.h"
33 #include "webkit/fileapi/file_system_mount_point_provider.h" 33 #include "webkit/fileapi/file_system_mount_point_provider.h"
34 #include "webkit/fileapi/file_system_util.h" 34 #include "webkit/fileapi/file_system_util.h"
35 #include "webkit/plugins/webplugininfo.h" 35 #include "webkit/plugins/webplugininfo.h"
36 36
37 #if defined(OS_CHROMEOS) 37 #if defined(OS_CHROMEOS)
38 #include "chrome/browser/chromeos/media/media_player.h" 38 #include "chrome/browser/chromeos/media/media_player.h"
39 #endif 39 #endif
40 40
41 using content::BrowserContext;
41 using content::BrowserThread; 42 using content::BrowserThread;
42 using content::PluginService; 43 using content::PluginService;
43 using content::UserMetricsAction; 44 using content::UserMetricsAction;
44 45
45 #define FILEBROWSER_DOMAIN "hhaomjibdihmijegdhdafkllkbggdgoj" 46 #define FILEBROWSER_DOMAIN "hhaomjibdihmijegdhdafkllkbggdgoj"
46 const char kFileBrowserDomain[] = FILEBROWSER_DOMAIN; 47 const char kFileBrowserDomain[] = FILEBROWSER_DOMAIN;
47 48
48 namespace file_manager_util { 49 namespace file_manager_util {
49 namespace { 50 namespace {
50 51
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 GURL base_url = fileapi::GetFileSystemRootURI(origin_url, 211 GURL base_url = fileapi::GetFileSystemRootURI(origin_url,
211 fileapi::kFileSystemTypeExternal); 212 fileapi::kFileSystemTypeExternal);
212 *url = GURL(base_url.spec() + virtual_path.value()); 213 *url = GURL(base_url.spec() + virtual_path.value());
213 return true; 214 return true;
214 } 215 }
215 216
216 bool ConvertFileToRelativeFileSystemPath( 217 bool ConvertFileToRelativeFileSystemPath(
217 Profile* profile, const FilePath& full_file_path, FilePath* virtual_path) { 218 Profile* profile, const FilePath& full_file_path, FilePath* virtual_path) {
218 fileapi::ExternalFileSystemMountPointProvider* provider = 219 fileapi::ExternalFileSystemMountPointProvider* provider =
219 profile->GetFileSystemContext()->external_provider(); 220 BrowserContext::GetFileSystemContext(profile)->external_provider();
220 if (!provider) 221 if (!provider)
221 return false; 222 return false;
222 223
223 // Find if this file path is managed by the external provider. 224 // Find if this file path is managed by the external provider.
224 if (!provider->GetVirtualPath(full_file_path, virtual_path)) 225 if (!provider->GetVirtualPath(full_file_path, virtual_path))
225 return false; 226 return false;
226 227
227 return true; 228 return true;
228 } 229 }
229 230
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 return; 426 return;
426 427
427 scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(service, 428 scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(service,
428 new ExtensionInstallUI(profile))); 429 new ExtensionInstallUI(profile)));
429 installer->set_is_gallery_install(false); 430 installer->set_is_gallery_install(false);
430 installer->set_allow_silent_install(false); 431 installer->set_allow_silent_install(false);
431 installer->InstallCrx(full_path); 432 installer->InstallCrx(full_path);
432 } 433 }
433 434
434 } // namespace file_manager_util 435 } // namespace file_manager_util
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/memory_purger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698