diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-03 03:41:43 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-03 03:41:43 +0000 |
commit | a0c91a9ffb1db127cf1f06e285b208a544ed4567 (patch) | |
tree | fe0e8f09a1c04cab35592cd46f9c01c045f95681 /chrome/browser/chromeos/extensions | |
parent | 68d3f6bbacbde53e968ae36ae3e4231ea1a8be4b (diff) | |
download | chromium_src-a0c91a9ffb1db127cf1f06e285b208a544ed4567.zip chromium_src-a0c91a9ffb1db127cf1f06e285b208a544ed4567.tar.gz chromium_src-a0c91a9ffb1db127cf1f06e285b208a544ed4567.tar.bz2 |
Drive extension functions from ExtensionFunction::Run. The
SyncExtensionFunction and AsyncExtensionFunction derivates now expose RunSync
and RunAsync respectively. New extension function implementations should just
implement Run directly.
BUG=365732
R=rockot@chromium.org
TBR=dmazzoni@chromium.org
Review URL: https://codereview.chromium.org/257333002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/extensions')
29 files changed, 142 insertions, 131 deletions
diff --git a/chrome/browser/chromeos/extensions/echo_private_api.cc b/chrome/browser/chromeos/extensions/echo_private_api.cc index 1ebc5f0..230c636 100644 --- a/chrome/browser/chromeos/extensions/echo_private_api.cc +++ b/chrome/browser/chromeos/extensions/echo_private_api.cc @@ -150,7 +150,7 @@ EchoPrivateGetOobeTimestampFunction::EchoPrivateGetOobeTimestampFunction() { EchoPrivateGetOobeTimestampFunction::~EchoPrivateGetOobeTimestampFunction() { } -bool EchoPrivateGetOobeTimestampFunction::RunImpl() { +bool EchoPrivateGetOobeTimestampFunction::RunAsync() { BrowserThread::PostTaskAndReplyWithResult( BrowserThread::FILE, FROM_HERE, base::Bind( @@ -199,7 +199,7 @@ EchoPrivateGetUserConsentFunction::CreateForTest( EchoPrivateGetUserConsentFunction::~EchoPrivateGetUserConsentFunction() {} -bool EchoPrivateGetUserConsentFunction::RunImpl() { +bool EchoPrivateGetUserConsentFunction::RunAsync() { CheckRedeemOffersAllowed(); return true; } diff --git a/chrome/browser/chromeos/extensions/echo_private_api.h b/chrome/browser/chromeos/extensions/echo_private_api.h index 2ec5bc7..20ea9ca 100644 --- a/chrome/browser/chromeos/extensions/echo_private_api.h +++ b/chrome/browser/chromeos/extensions/echo_private_api.h @@ -46,7 +46,7 @@ class EchoPrivateGetOobeTimestampFunction protected: virtual ~EchoPrivateGetOobeTimestampFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: bool GetOobeTimestampOnFileThread(); @@ -102,7 +102,7 @@ class EchoPrivateGetUserConsentFunction : public ChromeAsyncExtensionFunction, protected: virtual ~EchoPrivateGetUserConsentFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // chromeos::EchoDialogListener overrides. diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc index f80e275..bdf207e 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.cc @@ -284,7 +284,7 @@ FileBrowserHandlerInternalSelectFileFunction:: FileBrowserHandlerInternalSelectFileFunction:: ~FileBrowserHandlerInternalSelectFileFunction() {} -bool FileBrowserHandlerInternalSelectFileFunction::RunImpl() { +bool FileBrowserHandlerInternalSelectFileFunction::RunAsync() { scoped_ptr<SelectFile::Params> params(SelectFile::Params::Create(*args_)); base::FilePath suggested_name(params->selection_params.suggested_name); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h index 472782f..e130ae7 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_handler_api.h @@ -110,7 +110,7 @@ class FileBrowserHandlerInternalSelectFileFunction // AsyncExtensionFunction implementation. // Runs the extension function implementation. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Respond to the API with selected entry definition. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc index a96a1fc..375a7bd 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.cc @@ -25,14 +25,14 @@ SelectFileDialogExtension::RoutingID GetFileDialogRoutingID( } // namespace -bool FileBrowserPrivateCancelDialogFunction::RunImpl() { +bool FileBrowserPrivateCancelDialogFunction::RunAsync() { SelectFileDialogExtension::OnFileSelectionCanceled( GetFileDialogRoutingID(this)); SendResponse(true); return true; } -bool FileBrowserPrivateSelectFileFunction::RunImpl() { +bool FileBrowserPrivateSelectFileFunction::RunAsync() { using extensions::api::file_browser_private::SelectFile::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -73,7 +73,7 @@ void FileBrowserPrivateSelectFileFunction::GetSelectedFileInfoResponse( SendResponse(true); } -bool FileBrowserPrivateSelectFilesFunction::RunImpl() { +bool FileBrowserPrivateSelectFilesFunction::RunAsync() { using extensions::api::file_browser_private::SelectFiles::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h index 899f047..c333a15 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h @@ -29,7 +29,7 @@ class FileBrowserPrivateCancelDialogFunction virtual ~FileBrowserPrivateCancelDialogFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class FileBrowserPrivateSelectFileFunction @@ -42,7 +42,7 @@ class FileBrowserPrivateSelectFileFunction virtual ~FileBrowserPrivateSelectFileFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // A callback method to handle the result of GetSelectedFileInfo. @@ -62,7 +62,7 @@ class FileBrowserPrivateSelectFilesFunction virtual ~FileBrowserPrivateSelectFilesFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // A callback method to handle the result of GetSelectedFileInfo. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc index f5f1528..52dd4eb 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc @@ -349,7 +349,7 @@ FileBrowserPrivateGetDriveEntryPropertiesFunction:: FileBrowserPrivateGetDriveEntryPropertiesFunction:: ~FileBrowserPrivateGetDriveEntryPropertiesFunction() {} -bool FileBrowserPrivateGetDriveEntryPropertiesFunction::RunImpl() { +bool FileBrowserPrivateGetDriveEntryPropertiesFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using api::file_browser_private::GetDriveEntryProperties::Params; @@ -390,7 +390,7 @@ void FileBrowserPrivateGetDriveEntryPropertiesFunction:: SendResponse(true); } -bool FileBrowserPrivatePinDriveFileFunction::RunImpl() { +bool FileBrowserPrivatePinDriveFileFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::PinDriveFile::Params; @@ -437,7 +437,7 @@ FileBrowserPrivateGetDriveFilesFunction:: ~FileBrowserPrivateGetDriveFilesFunction() { } -bool FileBrowserPrivateGetDriveFilesFunction::RunImpl() { +bool FileBrowserPrivateGetDriveFilesFunction::RunAsync() { using extensions::api::file_browser_private::GetDriveFiles::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -503,7 +503,7 @@ void FileBrowserPrivateGetDriveFilesFunction::OnFileReady( GetFileOrSendResponse(); } -bool FileBrowserPrivateCancelFileTransfersFunction::RunImpl() { +bool FileBrowserPrivateCancelFileTransfersFunction::RunAsync() { using extensions::api::file_browser_private::CancelFileTransfers::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -557,7 +557,7 @@ bool FileBrowserPrivateCancelFileTransfersFunction::RunImpl() { return true; } -bool FileBrowserPrivateSearchDriveFunction::RunImpl() { +bool FileBrowserPrivateSearchDriveFunction::RunAsync() { using extensions::api::file_browser_private::SearchDrive::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -626,7 +626,7 @@ void FileBrowserPrivateSearchDriveFunction::OnEntryDefinitionList( SendResponse(true); } -bool FileBrowserPrivateSearchDriveMetadataFunction::RunImpl() { +bool FileBrowserPrivateSearchDriveMetadataFunction::RunAsync() { using api::file_browser_private::SearchDriveMetadata::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -770,7 +770,7 @@ bool FileBrowserPrivateGetDriveConnectionStateFunction::RunSync() { return true; } -bool FileBrowserPrivateRequestAccessTokenFunction::RunImpl() { +bool FileBrowserPrivateRequestAccessTokenFunction::RunAsync() { using extensions::api::file_browser_private::RequestAccessToken::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -804,7 +804,7 @@ void FileBrowserPrivateRequestAccessTokenFunction::OnAccessTokenFetched( SendResponse(true); } -bool FileBrowserPrivateGetShareUrlFunction::RunImpl() { +bool FileBrowserPrivateGetShareUrlFunction::RunAsync() { using extensions::api::file_browser_private::GetShareUrl::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -842,7 +842,7 @@ void FileBrowserPrivateGetShareUrlFunction::OnGetShareUrl( SendResponse(true); } -bool FileBrowserPrivateRequestDriveShareFunction::RunImpl() { +bool FileBrowserPrivateRequestDriveShareFunction::RunAsync() { using extensions::api::file_browser_private::RequestDriveShare::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h index f666c90..b3eec92 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.h @@ -41,7 +41,7 @@ class FileBrowserPrivateGetDriveEntryPropertiesFunction virtual ~FileBrowserPrivateGetDriveEntryPropertiesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void CompleteGetFileProperties(drive::FileError error); @@ -62,10 +62,10 @@ class FileBrowserPrivatePinDriveFileFunction virtual ~FileBrowserPrivatePinDriveFileFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Callback for RunImpl(). + // Callback for RunAsync(). void OnPinStateSet(drive::FileError error); }; @@ -89,7 +89,7 @@ class FileBrowserPrivateGetDriveFilesFunction virtual ~FileBrowserPrivateGetDriveFilesFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Gets the file on the top of the |remaining_drive_paths_| or sends the @@ -117,7 +117,7 @@ class FileBrowserPrivateCancelFileTransfersFunction virtual ~FileBrowserPrivateCancelFileTransfersFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class FileBrowserPrivateSearchDriveFunction @@ -131,7 +131,7 @@ class FileBrowserPrivateSearchDriveFunction protected: virtual ~FileBrowserPrivateSearchDriveFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Callback for Search(). @@ -159,7 +159,7 @@ class FileBrowserPrivateSearchDriveMetadataFunction protected: virtual ~FileBrowserPrivateSearchDriveMetadataFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Callback for SearchMetadata(); @@ -199,7 +199,7 @@ class FileBrowserPrivateRequestAccessTokenFunction virtual ~FileBrowserPrivateRequestAccessTokenFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Callback with a cached auth token (if available) or a fetched one. void OnAccessTokenFetched(google_apis::GDataErrorCode code, @@ -217,7 +217,7 @@ class FileBrowserPrivateGetShareUrlFunction virtual ~FileBrowserPrivateGetShareUrlFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Callback with an url to the sharing dialog as |share_url|, called by // FileSystem::GetShareUrl. @@ -233,7 +233,7 @@ class FileBrowserPrivateRequestDriveShareFunction protected: virtual ~FileBrowserPrivateRequestDriveShareFunction() {} - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Called back after the drive file system operation is finished. diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc index 0edaaaf..d150dcb 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc @@ -258,7 +258,7 @@ bool FileBrowserPrivateRequestFileSystemFunction:: return true; } -bool FileBrowserPrivateRequestFileSystemFunction::RunImpl() { +bool FileBrowserPrivateRequestFileSystemFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::RequestFileSystem::Params; const scoped_ptr<Params> params(Params::Create(*args_)); @@ -340,7 +340,7 @@ void FileWatchFunctionBase::Respond(bool success) { SendResponse(success); } -bool FileWatchFunctionBase::RunImpl() { +bool FileWatchFunctionBase::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!render_view_host() || !render_view_host()->GetProcess()) @@ -394,7 +394,7 @@ void FileBrowserPrivateRemoveFileWatchFunction::PerformFileWatchOperation( Respond(true); } -bool FileBrowserPrivateGetSizeStatsFunction::RunImpl() { +bool FileBrowserPrivateGetSizeStatsFunction::RunAsync() { using extensions::api::file_browser_private::GetSizeStats::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -469,7 +469,7 @@ void FileBrowserPrivateGetSizeStatsFunction::GetSizeStatsCallback( SendResponse(true); } -bool FileBrowserPrivateValidatePathNameLengthFunction::RunImpl() { +bool FileBrowserPrivateValidatePathNameLengthFunction::RunAsync() { using extensions::api::file_browser_private::ValidatePathNameLength::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -508,7 +508,7 @@ void FileBrowserPrivateValidatePathNameLengthFunction::OnFilePathLimitRetrieved( SendResponse(true); } -bool FileBrowserPrivateFormatVolumeFunction::RunImpl() { +bool FileBrowserPrivateFormatVolumeFunction::RunAsync() { using extensions::api::file_browser_private::FormatVolume::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -529,7 +529,7 @@ bool FileBrowserPrivateFormatVolumeFunction::RunImpl() { return true; } -bool FileBrowserPrivateStartCopyFunction::RunImpl() { +bool FileBrowserPrivateStartCopyFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::StartCopy::Params; @@ -578,7 +578,7 @@ void FileBrowserPrivateStartCopyFunction::RunAfterStartCopy( SendResponse(true); } -bool FileBrowserPrivateCancelCopyFunction::RunImpl() { +bool FileBrowserPrivateCancelCopyFunction::RunAsync() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); using extensions::api::file_browser_private::CancelCopy::Params; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h index b3d4280..6209105 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h @@ -42,7 +42,7 @@ class FileBrowserPrivateRequestFileSystemFunction virtual ~FileBrowserPrivateRequestFileSystemFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void RespondSuccessOnUIThread(const std::string& name, @@ -81,7 +81,7 @@ class FileWatchFunctionBase : public LoggedAsyncExtensionFunction { const std::string& extension_id) = 0; // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Calls SendResponse() with |success| converted to base::Value. void Respond(bool success); @@ -133,7 +133,7 @@ class FileBrowserPrivateGetSizeStatsFunction virtual ~FileBrowserPrivateGetSizeStatsFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void GetDriveAvailableSpaceCallback(drive::FileError error, @@ -157,7 +157,7 @@ class FileBrowserPrivateValidatePathNameLengthFunction void OnFilePathLimitRetrieved(size_t current_length, size_t max_length); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the chrome.fileBrowserPrivate.formatVolume method. @@ -172,7 +172,7 @@ class FileBrowserPrivateFormatVolumeFunction virtual ~FileBrowserPrivateFormatVolumeFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements the chrome.fileBrowserPrivate.startCopy method. @@ -186,10 +186,10 @@ class FileBrowserPrivateStartCopyFunction virtual ~FileBrowserPrivateStartCopyFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: - // Part of RunImpl(). Called after Copy() is started on IO thread. + // Part of RunAsync(). Called after Copy() is started on IO thread. void RunAfterStartCopy(int operation_id); }; @@ -204,7 +204,7 @@ class FileBrowserPrivateCancelCopyFunction virtual ~FileBrowserPrivateCancelCopyFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions 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 2fcabf5..ce1e3af 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc @@ -168,7 +168,7 @@ FileBrowserPrivateZipSelectionFunction:: FileBrowserPrivateZipSelectionFunction:: ~FileBrowserPrivateZipSelectionFunction() {} -bool FileBrowserPrivateZipSelectionFunction::RunImpl() { +bool FileBrowserPrivateZipSelectionFunction::RunAsync() { using extensions::api::file_browser_private::ZipSelection::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -253,7 +253,7 @@ bool FileBrowserPrivateZoomFunction::RunSync() { return true; } -bool FileBrowserPrivateInstallWebstoreItemFunction::RunImpl() { +bool FileBrowserPrivateInstallWebstoreItemFunction::RunAsync() { using extensions::api::file_browser_private::InstallWebstoreItem::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -308,7 +308,7 @@ FileBrowserPrivateRequestWebStoreAccessTokenFunction:: ~FileBrowserPrivateRequestWebStoreAccessTokenFunction() { } -bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunImpl() { +bool FileBrowserPrivateRequestWebStoreAccessTokenFunction::RunAsync() { std::vector<std::string> scopes; scopes.push_back(kCWSScope); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h index 628a635..d6f4a59 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.h @@ -74,7 +74,7 @@ class FileBrowserPrivateZipSelectionFunction virtual ~FileBrowserPrivateZipSelectionFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; // Receives the result from ZipFileCreator. void OnZipDone(bool success); @@ -107,7 +107,7 @@ class FileBrowserPrivateInstallWebstoreItemFunction virtual ~FileBrowserPrivateInstallWebstoreItemFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; void OnInstallComplete(bool success, const std::string& error); private: @@ -124,7 +124,7 @@ class FileBrowserPrivateRequestWebStoreAccessTokenFunction protected: virtual ~FileBrowserPrivateRequestWebStoreAccessTokenFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: scoped_ptr<google_apis::AuthServiceInterface> auth_service_; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc index 16fa5ac..e30dd19 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.cc @@ -25,7 +25,7 @@ namespace file_browser_private = extensions::api::file_browser_private; namespace extensions { -bool FileBrowserPrivateAddMountFunction::RunImpl() { +bool FileBrowserPrivateAddMountFunction::RunAsync() { using file_browser_private::AddMount::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -89,7 +89,7 @@ void FileBrowserPrivateAddMountFunction::RunAfterMarkCacheFileAsMounted( chromeos::MOUNT_TYPE_ARCHIVE); } -bool FileBrowserPrivateRemoveMountFunction::RunImpl() { +bool FileBrowserPrivateRemoveMountFunction::RunAsync() { using file_browser_private::RemoveMount::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -143,7 +143,7 @@ bool FileBrowserPrivateRemoveMountFunction::RunImpl() { return true; } -bool FileBrowserPrivateGetVolumeMetadataListFunction::RunImpl() { +bool FileBrowserPrivateGetVolumeMetadataListFunction::RunAsync() { if (args_->GetSize()) return false; diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h index b66f8e0..69c2d9d 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_mount.h @@ -30,11 +30,11 @@ class FileBrowserPrivateAddMountFunction : public LoggedAsyncExtensionFunction { virtual ~FileBrowserPrivateAddMountFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Part of Run(). Called after MarkCacheFielAsMounted for Drive File System. - // (or directly called from RunImpl() for other file system). + // (or directly called from RunAsync() for other file system). void RunAfterMarkCacheFileAsMounted(const base::FilePath& display_name, drive::FileError error, const base::FilePath& file_path); @@ -52,7 +52,7 @@ class FileBrowserPrivateRemoveMountFunction virtual ~FileBrowserPrivateRemoveMountFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; // Implements chrome.fileBrowserPrivate.getVolumeMetadataList method. @@ -66,7 +66,7 @@ class FileBrowserPrivateGetVolumeMetadataListFunction virtual ~FileBrowserPrivateGetVolumeMetadataListFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc index 0e703c5..e2cb9fe 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc @@ -87,7 +87,7 @@ void SniffMimeType(PathAndMimeTypeSet* path_mime_set, } // namespace -bool FileBrowserPrivateExecuteTaskFunction::RunImpl() { +bool FileBrowserPrivateExecuteTaskFunction::RunAsync() { using extensions::api::file_browser_private::ExecuteTask::Params; using extensions::api::file_browser_private::ExecuteTask::Results::Create; const scoped_ptr<Params> params(Params::Create(*args_)); @@ -146,7 +146,7 @@ void FileBrowserPrivateExecuteTaskFunction::OnTaskExecuted( extensions::api::file_browser_private::TASK_RESULT_FAILED); } -bool FileBrowserPrivateGetFileTasksFunction::RunImpl() { +bool FileBrowserPrivateGetFileTasksFunction::RunAsync() { using extensions::api::file_browser_private::GetFileTasks::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h index 0c9f027..6f0a75e 100644 --- a/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h +++ b/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h @@ -26,7 +26,7 @@ class FileBrowserPrivateExecuteTaskFunction virtual ~FileBrowserPrivateExecuteTaskFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnTaskExecuted( @@ -44,7 +44,7 @@ class FileBrowserPrivateGetFileTasksFunction virtual ~FileBrowserPrivateGetFileTasksFunction() {} // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: void OnSniffingMimeTypeCompleted( diff --git a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc index 8e378db..d37f23c 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc +++ b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.cc @@ -85,7 +85,7 @@ bool FileSystemProviderUnmountFunction::RunSync() { return true; } -bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunSync() { +bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunWhenValid() { using api::file_system_provider_internal::UnmountRequestedSuccess::Params; scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -95,7 +95,7 @@ bool FileSystemProviderInternalUnmountRequestedSuccessFunction::RunSync() { return true; } -bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunSync() { +bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunWhenValid() { using api::file_system_provider_internal::UnmountRequestedError::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -104,7 +104,8 @@ bool FileSystemProviderInternalUnmountRequestedErrorFunction::RunSync() { return true; } -bool FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunSync() { +bool +FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunWhenValid() { using api::file_system_provider_internal::GetMetadataRequestedSuccess::Params; scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -114,7 +115,8 @@ bool FileSystemProviderInternalGetMetadataRequestedSuccessFunction::RunSync() { return true; } -bool FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunSync() { +bool +FileSystemProviderInternalGetMetadataRequestedErrorFunction::RunWhenValid() { using api::file_system_provider_internal::GetMetadataRequestedError::Params; const scoped_ptr<Params> params(Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h index 728513c..b762701 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h +++ b/chrome/browser/chromeos/extensions/file_system_provider/file_system_provider_api.h @@ -39,7 +39,7 @@ class FileSystemProviderInternalUnmountRequestedSuccessFunction protected: virtual ~FileSystemProviderInternalUnmountRequestedSuccessFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalUnmountRequestedErrorFunction @@ -51,7 +51,7 @@ class FileSystemProviderInternalUnmountRequestedErrorFunction protected: virtual ~FileSystemProviderInternalUnmountRequestedErrorFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalGetMetadataRequestedSuccessFunction @@ -63,7 +63,7 @@ class FileSystemProviderInternalGetMetadataRequestedSuccessFunction protected: virtual ~FileSystemProviderInternalGetMetadataRequestedSuccessFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; class FileSystemProviderInternalGetMetadataRequestedErrorFunction @@ -75,7 +75,7 @@ class FileSystemProviderInternalGetMetadataRequestedErrorFunction protected: virtual ~FileSystemProviderInternalGetMetadataRequestedErrorFunction() {} - virtual bool RunSync() OVERRIDE; + virtual bool RunWhenValid() OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc index 3ef54d7..53a3206 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc +++ b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.cc @@ -94,12 +94,12 @@ void FileSystemProviderInternalFunction::FulfillRequest( SetErrorResponse(kSecurityErrorName, kResponseFailedErrorMessage); } -bool FileSystemProviderInternalFunction::RunImpl() { +bool FileSystemProviderInternalFunction::RunSync() { DCHECK(args_); if (!Parse()) return true; - SendResponse(RunSync()); + SendResponse(RunWhenValid()); return true; } diff --git a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h index 10e8789..ed689c2c 100644 --- a/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h +++ b/chrome/browser/chromeos/extensions/file_system_provider/provider_function.h @@ -68,10 +68,15 @@ class FileSystemProviderInternalFunction : public ChromeSyncExtensionFunction { scoped_ptr<chromeos::file_system_provider::RequestValue> value, bool has_next); - // ChromeSyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + // Subclasses implement this for their functionality. + // Called after Parse() is successful, such that |request_id_| and + // |request_manager_| have been fully initialized. + virtual bool RunWhenValid() = 0; private: + // ChromeSyncExtensionFunction overrides. + virtual bool RunSync() OVERRIDE; + // Parses the request in order to extract the request manager. If fails, then // sets a response and returns false. bool Parse(); diff --git a/chrome/browser/chromeos/extensions/info_private_api.cc b/chrome/browser/chromeos/extensions/info_private_api.cc index f7c9514..4d13dcf 100644 --- a/chrome/browser/chromeos/extensions/info_private_api.cc +++ b/chrome/browser/chromeos/extensions/info_private_api.cc @@ -112,7 +112,7 @@ ChromeosInfoPrivateGetFunction::ChromeosInfoPrivateGetFunction() { ChromeosInfoPrivateGetFunction::~ChromeosInfoPrivateGetFunction() { } -bool ChromeosInfoPrivateGetFunction::RunImpl() { +bool ChromeosInfoPrivateGetFunction::RunAsync() { base::ListValue* list = NULL; EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &list)); scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue()); diff --git a/chrome/browser/chromeos/extensions/info_private_api.h b/chrome/browser/chromeos/extensions/info_private_api.h index 14f2e68..afa531c 100644 --- a/chrome/browser/chromeos/extensions/info_private_api.h +++ b/chrome/browser/chromeos/extensions/info_private_api.h @@ -23,7 +23,7 @@ class ChromeosInfoPrivateGetFunction : public AsyncExtensionFunction { protected: virtual ~ChromeosInfoPrivateGetFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Returns a newly allocate value, or null. diff --git a/chrome/browser/chromeos/extensions/screenlock_private_api.cc b/chrome/browser/chromeos/extensions/screenlock_private_api.cc index c22fb4d..ed6f171 100644 --- a/chrome/browser/chromeos/extensions/screenlock_private_api.cc +++ b/chrome/browser/chromeos/extensions/screenlock_private_api.cc @@ -61,7 +61,7 @@ ScreenlockPrivateGetLockedFunction::ScreenlockPrivateGetLockedFunction() {} ScreenlockPrivateGetLockedFunction::~ScreenlockPrivateGetLockedFunction() {} -bool ScreenlockPrivateGetLockedFunction::RunImpl() { +bool ScreenlockPrivateGetLockedFunction::RunAsync() { bool locked = false; chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); @@ -76,7 +76,7 @@ ScreenlockPrivateSetLockedFunction::ScreenlockPrivateSetLockedFunction() {} ScreenlockPrivateSetLockedFunction::~ScreenlockPrivateSetLockedFunction() {} -bool ScreenlockPrivateSetLockedFunction::RunImpl() { +bool ScreenlockPrivateSetLockedFunction::RunAsync() { scoped_ptr<screenlock::SetLocked::Params> params( screenlock::SetLocked::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -98,7 +98,7 @@ ScreenlockPrivateShowMessageFunction::ScreenlockPrivateShowMessageFunction() {} ScreenlockPrivateShowMessageFunction::~ScreenlockPrivateShowMessageFunction() {} -bool ScreenlockPrivateShowMessageFunction::RunImpl() { +bool ScreenlockPrivateShowMessageFunction::RunAsync() { scoped_ptr<screenlock::ShowMessage::Params> params( screenlock::ShowMessage::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -118,7 +118,7 @@ ScreenlockPrivateShowButtonFunction:: ScreenlockPrivateShowButtonFunction:: ~ScreenlockPrivateShowButtonFunction() {} -bool ScreenlockPrivateShowButtonFunction::RunImpl() { +bool ScreenlockPrivateShowButtonFunction::RunAsync() { scoped_ptr<screenlock::ShowButton::Params> params( screenlock::ShowButton::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -157,7 +157,7 @@ ScreenlockPrivateHideButtonFunction::ScreenlockPrivateHideButtonFunction() {} ScreenlockPrivateHideButtonFunction::~ScreenlockPrivateHideButtonFunction() {} -bool ScreenlockPrivateHideButtonFunction::RunImpl() { +bool ScreenlockPrivateHideButtonFunction::RunAsync() { chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); if (locker) { @@ -175,7 +175,7 @@ ScreenlockPrivateSetAuthTypeFunction::ScreenlockPrivateSetAuthTypeFunction() {} ScreenlockPrivateSetAuthTypeFunction::~ScreenlockPrivateSetAuthTypeFunction() {} -bool ScreenlockPrivateSetAuthTypeFunction::RunImpl() { +bool ScreenlockPrivateSetAuthTypeFunction::RunAsync() { scoped_ptr<screenlock::SetAuthType::Params> params( screenlock::SetAuthType::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); @@ -201,7 +201,7 @@ ScreenlockPrivateGetAuthTypeFunction::ScreenlockPrivateGetAuthTypeFunction() {} ScreenlockPrivateGetAuthTypeFunction::~ScreenlockPrivateGetAuthTypeFunction() {} -bool ScreenlockPrivateGetAuthTypeFunction::RunImpl() { +bool ScreenlockPrivateGetAuthTypeFunction::RunAsync() { chromeos::ScreenLocker* locker = chromeos::ScreenLocker::default_screen_locker(); if (locker) { @@ -225,7 +225,7 @@ ScreenlockPrivateAcceptAuthAttemptFunction:: ScreenlockPrivateAcceptAuthAttemptFunction:: ~ScreenlockPrivateAcceptAuthAttemptFunction() {} -bool ScreenlockPrivateAcceptAuthAttemptFunction::RunImpl() { +bool ScreenlockPrivateAcceptAuthAttemptFunction::RunAsync() { scoped_ptr<screenlock::AcceptAuthAttempt::Params> params( screenlock::AcceptAuthAttempt::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params.get()); diff --git a/chrome/browser/chromeos/extensions/screenlock_private_api.h b/chrome/browser/chromeos/extensions/screenlock_private_api.h index 7e597d2..97dd94d 100644 --- a/chrome/browser/chromeos/extensions/screenlock_private_api.h +++ b/chrome/browser/chromeos/extensions/screenlock_private_api.h @@ -21,7 +21,8 @@ class ScreenlockPrivateGetLockedFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getLocked", SCREENLOCKPRIVATE_GETLOCKED) ScreenlockPrivateGetLockedFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateGetLockedFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateGetLockedFunction); @@ -32,7 +33,8 @@ class ScreenlockPrivateSetLockedFunction : public ChromeAsyncExtensionFunction { DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setLocked", SCREENLOCKPRIVATE_SETLOCKED) ScreenlockPrivateSetLockedFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateSetLockedFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateSetLockedFunction); @@ -44,7 +46,8 @@ class ScreenlockPrivateShowMessageFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showMessage", SCREENLOCKPRIVATE_SHOWMESSAGE) ScreenlockPrivateShowMessageFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateShowMessageFunction(); DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateShowMessageFunction ); @@ -56,7 +59,8 @@ class ScreenlockPrivateShowButtonFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.showButton", SCREENLOCKPRIVATE_SHOWBUTTON) ScreenlockPrivateShowButtonFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; + private: virtual ~ScreenlockPrivateShowButtonFunction(); void OnImageLoaded(const gfx::Image& image); @@ -69,7 +73,7 @@ class ScreenlockPrivateHideButtonFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.hideButton", SCREENLOCKPRIVATE_HIDEBUTTON) ScreenlockPrivateHideButtonFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateHideButtonFunction(); @@ -83,7 +87,7 @@ class ScreenlockPrivateSetAuthTypeFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.setAuthType", SCREENLOCKPRIVATE_SETAUTHTYPE) ScreenlockPrivateSetAuthTypeFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateSetAuthTypeFunction(); @@ -96,7 +100,7 @@ class ScreenlockPrivateGetAuthTypeFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.getAuthType", SCREENLOCKPRIVATE_GETAUTHTYPE) ScreenlockPrivateGetAuthTypeFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateGetAuthTypeFunction(); @@ -109,7 +113,7 @@ class ScreenlockPrivateAcceptAuthAttemptFunction DECLARE_EXTENSION_FUNCTION("screenlockPrivate.acceptAuthAttempt", SCREENLOCKPRIVATE_ACCEPTAUTHATTEMPT) ScreenlockPrivateAcceptAuthAttemptFunction(); - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual ~ScreenlockPrivateAcceptAuthAttemptFunction(); diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc index 383c7c7..7ce929d 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc @@ -93,7 +93,7 @@ WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() { WallpaperSetWallpaperFunction::~WallpaperSetWallpaperFunction() { } -bool WallpaperSetWallpaperFunction::RunImpl() { +bool WallpaperSetWallpaperFunction::RunAsync() { params_ = set_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params_); diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.h b/chrome/browser/chromeos/extensions/wallpaper_api.h index 7fe549d..493ff55 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_api.h +++ b/chrome/browser/chromeos/extensions/wallpaper_api.h @@ -29,7 +29,7 @@ class WallpaperSetWallpaperFunction : public WallpaperFunctionBase { virtual ~WallpaperSetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index f74db97..9643385 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc @@ -285,7 +285,7 @@ WallpaperPrivateSetWallpaperIfExistsFunction:: WallpaperPrivateSetWallpaperIfExistsFunction:: ~WallpaperPrivateSetWallpaperIfExistsFunction() {} -bool WallpaperPrivateSetWallpaperIfExistsFunction::RunImpl() { +bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { params = set_wallpaper_if_exists::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -388,7 +388,7 @@ WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() { WallpaperPrivateSetWallpaperFunction::~WallpaperPrivateSetWallpaperFunction() { } -bool WallpaperPrivateSetWallpaperFunction::RunImpl() { +bool WallpaperPrivateSetWallpaperFunction::RunAsync() { params = set_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -489,7 +489,7 @@ WallpaperPrivateResetWallpaperFunction:: WallpaperPrivateResetWallpaperFunction:: ~WallpaperPrivateResetWallpaperFunction() {} -bool WallpaperPrivateResetWallpaperFunction::RunImpl() { +bool WallpaperPrivateResetWallpaperFunction::RunAsync() { chromeos::WallpaperManager* wallpaper_manager = chromeos::WallpaperManager::Get(); chromeos::UserManager* user_manager = chromeos::UserManager::Get(); @@ -517,7 +517,7 @@ WallpaperPrivateSetCustomWallpaperFunction:: WallpaperPrivateSetCustomWallpaperFunction:: ~WallpaperPrivateSetCustomWallpaperFunction() {} -bool WallpaperPrivateSetCustomWallpaperFunction::RunImpl() { +bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { params = set_custom_wallpaper::Params::Create(*args_); EXTENSION_FUNCTION_VALIDATE(params); @@ -609,7 +609,7 @@ WallpaperPrivateSetCustomWallpaperLayoutFunction:: WallpaperPrivateSetCustomWallpaperLayoutFunction:: ~WallpaperPrivateSetCustomWallpaperLayoutFunction() {} -bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunImpl() { +bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() { scoped_ptr<set_custom_wallpaper_layout::Params> params( set_custom_wallpaper_layout::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -645,7 +645,7 @@ WallpaperPrivateMinimizeInactiveWindowsFunction:: ~WallpaperPrivateMinimizeInactiveWindowsFunction() { } -bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl() { +bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync() { WindowStateManager::MinimizeInactiveWindows( chromeos::UserManager::Get()->GetActiveUser()->username_hash()); return true; @@ -659,7 +659,7 @@ WallpaperPrivateRestoreMinimizedWindowsFunction:: ~WallpaperPrivateRestoreMinimizedWindowsFunction() { } -bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunImpl() { +bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync() { WindowStateManager::RestoreWindows( chromeos::UserManager::Get()->GetActiveUser()->username_hash()); return true; @@ -671,7 +671,7 @@ WallpaperPrivateGetThumbnailFunction::WallpaperPrivateGetThumbnailFunction() { WallpaperPrivateGetThumbnailFunction::~WallpaperPrivateGetThumbnailFunction() { } -bool WallpaperPrivateGetThumbnailFunction::RunImpl() { +bool WallpaperPrivateGetThumbnailFunction::RunAsync() { scoped_ptr<get_thumbnail::Params> params( get_thumbnail::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -758,7 +758,7 @@ WallpaperPrivateSaveThumbnailFunction::WallpaperPrivateSaveThumbnailFunction() { WallpaperPrivateSaveThumbnailFunction:: ~WallpaperPrivateSaveThumbnailFunction() {} -bool WallpaperPrivateSaveThumbnailFunction::RunImpl() { +bool WallpaperPrivateSaveThumbnailFunction::RunAsync() { scoped_ptr<save_thumbnail::Params> params( save_thumbnail::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); @@ -811,7 +811,7 @@ WallpaperPrivateGetOfflineWallpaperListFunction:: ~WallpaperPrivateGetOfflineWallpaperListFunction() { } -bool WallpaperPrivateGetOfflineWallpaperListFunction::RunImpl() { +bool WallpaperPrivateGetOfflineWallpaperListFunction::RunAsync() { sequence_token_ = BrowserThread::GetBlockingPool()-> GetNamedSequenceToken(chromeos::kWallpaperSequenceTokenName); scoped_refptr<base::SequencedTaskRunner> task_runner = diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.h b/chrome/browser/chromeos/extensions/wallpaper_private_api.h index 5586c8b..a9be422 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.h +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.h @@ -39,7 +39,7 @@ class WallpaperPrivateSetWallpaperIfExistsFunction virtual ~WallpaperPrivateSetWallpaperIfExistsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; @@ -74,7 +74,7 @@ class WallpaperPrivateSetWallpaperFunction : public WallpaperFunctionBase { virtual ~WallpaperPrivateSetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& image) OVERRIDE; @@ -111,7 +111,7 @@ class WallpaperPrivateResetWallpaperFunction virtual ~WallpaperPrivateResetWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateSetCustomWallpaperFunction @@ -126,7 +126,7 @@ class WallpaperPrivateSetCustomWallpaperFunction virtual ~WallpaperPrivateSetCustomWallpaperFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: virtual void OnWallpaperDecoded(const gfx::ImageSkia& wallpaper) OVERRIDE; @@ -165,7 +165,7 @@ class WallpaperPrivateSetCustomWallpaperLayoutFunction virtual ~WallpaperPrivateSetCustomWallpaperLayoutFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateMinimizeInactiveWindowsFunction @@ -180,7 +180,7 @@ class WallpaperPrivateMinimizeInactiveWindowsFunction virtual ~WallpaperPrivateMinimizeInactiveWindowsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateRestoreMinimizedWindowsFunction @@ -195,7 +195,7 @@ class WallpaperPrivateRestoreMinimizedWindowsFunction virtual ~WallpaperPrivateRestoreMinimizedWindowsFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; }; class WallpaperPrivateGetThumbnailFunction : public AsyncExtensionFunction { @@ -209,7 +209,7 @@ class WallpaperPrivateGetThumbnailFunction : public AsyncExtensionFunction { virtual ~WallpaperPrivateGetThumbnailFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Failed to get thumbnail for |file_name|. @@ -242,7 +242,7 @@ class WallpaperPrivateSaveThumbnailFunction : public AsyncExtensionFunction { virtual ~WallpaperPrivateSaveThumbnailFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Failed to save thumbnail for |file_name|. @@ -270,7 +270,7 @@ class WallpaperPrivateGetOfflineWallpaperListFunction virtual ~WallpaperPrivateGetOfflineWallpaperListFunction(); // AsyncExtensionFunction overrides. - virtual bool RunImpl() OVERRIDE; + virtual bool RunAsync() OVERRIDE; private: // Enumerates the list of files in online wallpaper directory. diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc index ea63359..515f586 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api_unittest.cc @@ -51,8 +51,8 @@ class TestMinimizeFunction public: TestMinimizeFunction() {} - virtual bool RunImpl() OVERRIDE { - return WallpaperPrivateMinimizeInactiveWindowsFunction::RunImpl(); + virtual bool RunAsync() OVERRIDE { + return WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync(); } protected: @@ -64,8 +64,8 @@ class TestRestoreFunction public: TestRestoreFunction() {} - virtual bool RunImpl() OVERRIDE { - return WallpaperPrivateRestoreMinimizedWindowsFunction::RunImpl(); + virtual bool RunAsync() OVERRIDE { + return WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync(); } protected: virtual ~TestRestoreFunction() {} @@ -100,7 +100,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function->RunImpl()); + EXPECT_TRUE(minimize_function->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -112,7 +112,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndRestoreWindows) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function( new TestRestoreFunction()); - EXPECT_TRUE(restore_function->RunImpl()); + EXPECT_TRUE(restore_function->RunAsync()); // Windows 1 and 2 should no longer be minimized. Window 1 should again // be maximized. Window 3 should still be minimized. @@ -140,7 +140,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -150,7 +150,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { // change. scoped_refptr<TestMinimizeFunction> minimize_function_1( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_1->RunImpl()); + EXPECT_TRUE(minimize_function_1->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -163,7 +163,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { scoped_refptr<TestMinimizeFunction> minimize_function_2( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_2->RunImpl()); + EXPECT_TRUE(minimize_function_2->RunAsync()); // Window 1 should be minimized again. EXPECT_FALSE(window0_state->IsMinimized()); @@ -173,7 +173,7 @@ TEST_F(WallpaperPrivateApiUnittest, HideAndManualUnminimizeWindows) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function( new TestRestoreFunction()); - EXPECT_TRUE(restore_function->RunImpl()); + EXPECT_TRUE(restore_function->RunAsync()); // Windows 1 should no longer be minimized. EXPECT_FALSE(window1_state->IsMinimized()); @@ -280,7 +280,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -298,7 +298,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { EXPECT_TRUE(window2_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_1( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_1->RunImpl()); + EXPECT_TRUE(minimize_function_1->RunAsync()); // All windows except window 2 should be minimized. EXPECT_FALSE(window2_state->IsMinimized()); @@ -322,7 +322,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { window2.reset(); scoped_refptr<TestRestoreFunction> restore_function_0( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_0->RunImpl()); + EXPECT_TRUE(restore_function_0->RunAsync()); EXPECT_FALSE(window3_state->IsMinimized()); @@ -336,7 +336,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideAndRestoreWindowsTwoUsers) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function_1( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_1->RunImpl()); + EXPECT_TRUE(restore_function_1->RunAsync()); EXPECT_FALSE(window1_state->IsMinimized()); EXPECT_FALSE(window3_state->IsMinimized()); @@ -380,7 +380,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideTeleportedWindow) { EXPECT_TRUE(window0_state->IsActive()); scoped_refptr<TestMinimizeFunction> minimize_function_0( new TestMinimizeFunction()); - EXPECT_TRUE(minimize_function_0->RunImpl()); + EXPECT_TRUE(minimize_function_0->RunAsync()); // All windows except window 0 should be minimized. EXPECT_FALSE(window0_state->IsMinimized()); @@ -395,7 +395,7 @@ TEST_F(WallpaperPrivateApiMultiUserUnittest, HideTeleportedWindow) { window0.reset(); scoped_refptr<TestRestoreFunction> restore_function_1( new TestRestoreFunction()); - EXPECT_TRUE(restore_function_1->RunImpl()); + EXPECT_TRUE(restore_function_1->RunAsync()); EXPECT_FALSE(window1_state->IsMinimized()); EXPECT_FALSE(window2_state->IsMinimized()); |