diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-28 21:19:23 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-28 21:19:23 +0000 |
commit | 21a40087a57e13cc9b81cb7e8064f74587dfa8a1 (patch) | |
tree | e88d44c64fcaa47a5b45533a4d6c993de770757c /chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc | |
parent | 0f75118d4799a7c5421150826eaccd1dfd253f8e (diff) | |
download | chromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.zip chromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.tar.gz chromium_src-21a40087a57e13cc9b81cb7e8064f74587dfa8a1.tar.bz2 |
Remove Profile dependency from ExtensionFunction
This instead creates new variants of ExtensionFunction for Chrome APIs,
which need Profile, and uses them for any API that needs to access
Profiles.
TBR=sky@chromium.org
BUG=297942
Review URL: https://codereview.chromium.org/35893010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc')
-rw-r--r-- | chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc index 45c50e1..141721f 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc @@ -38,9 +38,9 @@ bool FileBrowserPrivateLogoutUserFunction::RunImpl() { bool FileBrowserPrivateGetPreferencesFunction::RunImpl() { api::file_browser_private::GetPreferences::Results::Result result; - const PrefService* const service = profile_->GetPrefs(); + const PrefService* const service = GetProfile()->GetPrefs(); - result.drive_enabled = drive::util::IsDriveEnabledForProfile(profile_); + result.drive_enabled = drive::util::IsDriveEnabledForProfile(GetProfile()); result.cellular_disabled = service->GetBoolean(prefs::kDisableDriveOverCellular); result.hosted_files_disabled = @@ -64,7 +64,7 @@ bool FileBrowserPrivateSetPreferencesFunction::RunImpl() { const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - PrefService* const service = profile_->GetPrefs(); + PrefService* const service = GetProfile()->GetPrefs(); if (params->change_info.cellular_disabled) service->SetBoolean(prefs::kDisableDriveOverCellular, @@ -94,7 +94,7 @@ bool FileBrowserPrivateZipSelectionFunction::RunImpl() { return false; base::FilePath src_dir = file_manager::util::GetLocalPathFromURL( - render_view_host(), profile(), GURL(params->dir_url)); + render_view_host(), GetProfile(), GURL(params->dir_url)); if (src_dir.empty()) return false; @@ -105,7 +105,7 @@ bool FileBrowserPrivateZipSelectionFunction::RunImpl() { std::vector<base::FilePath> files; for (size_t i = 0; i < params->selection_urls.size(); ++i) { base::FilePath path = file_manager::util::GetLocalPathFromURL( - render_view_host(), profile(), GURL(params->selection_urls[i])); + render_view_host(), GetProfile(), GURL(params->selection_urls[i])); if (path.empty()) return false; files.push_back(path); @@ -192,7 +192,7 @@ bool FileBrowserPrivateInstallWebstoreItemFunction::RunImpl() { new file_manager::FileManagerInstaller( GetAssociatedWebContents(), // web_contents(), params->item_id, - profile(), + GetProfile(), callback)); // installer will be AddRef()'d in BeginInstall(). installer->BeginInstall(); @@ -230,7 +230,7 @@ bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunImpl() { scopes.push_back(kCWSScope); ProfileOAuth2TokenService* oauth_service = - ProfileOAuth2TokenServiceFactory::GetForProfile(profile()); + ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile()); net::URLRequestContextGetter* url_request_context_getter = g_browser_process->system_request_context(); |