diff options
Diffstat (limited to 'chrome/browser/extensions')
19 files changed, 86 insertions, 59 deletions
diff --git a/chrome/browser/extensions/activity_database.h b/chrome/browser/extensions/activity_database.h index 89daecf..1c73dc9 100644 --- a/chrome/browser/extensions/activity_database.h +++ b/chrome/browser/extensions/activity_database.h @@ -14,7 +14,9 @@ #include "sql/connection.h" #include "sql/init_status.h" +namespace base { class FilePath; +} namespace extensions { @@ -30,7 +32,7 @@ class ActivityDatabase : public base::RefCountedThreadSafe<ActivityDatabase> { void SetErrorDelegate(sql::ErrorDelegate* error_delegate); // Opens the DB and creates tables as necessary. - void Init(const FilePath& db_name); + void Init(const base::FilePath& db_name); void LogInitFailure(); // Record a UrlAction in the database. diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h index 1b12fd5..44e2259 100644 --- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.h +++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.h @@ -17,9 +17,8 @@ #include "chrome/browser/extensions/extension_function.h" #include "ui/shell_dialogs/select_file_dialog.h" -class FilePath; - namespace base { +class FilePath; class ListValue; } @@ -274,10 +273,10 @@ class BookmarksIOFunction : public BookmarksFunction, public: BookmarksIOFunction(); - virtual void FileSelected(const FilePath& path, int index, void* params) = 0; + virtual void FileSelected(const base::FilePath& path, int index, void* params) = 0; // ui::SelectFileDialog::Listener: - virtual void MultiFilesSelected(const std::vector<FilePath>& files, + virtual void MultiFilesSelected(const std::vector<base::FilePath>& files, void* params) OVERRIDE; virtual void FileSelectionCanceled(void* params) OVERRIDE; @@ -289,7 +288,7 @@ class BookmarksIOFunction : public BookmarksFunction, private: void ShowSelectFileDialog( ui::SelectFileDialog::Type type, - const FilePath& default_path); + const base::FilePath& default_path); protected: scoped_refptr<ui::SelectFileDialog> select_file_dialog_; @@ -300,7 +299,7 @@ class BookmarksImportFunction : public BookmarksIOFunction { DECLARE_EXTENSION_FUNCTION("bookmarks.import", BOOKMARKS_IMPORT) // BookmarkManagerIOFunction: - virtual void FileSelected(const FilePath& path, + virtual void FileSelected(const base::FilePath& path, int index, void* params) OVERRIDE; @@ -316,7 +315,7 @@ class BookmarksExportFunction : public BookmarksIOFunction { DECLARE_EXTENSION_FUNCTION("bookmarks.export", BOOKMARKS_EXPORT) // BookmarkManagerIOFunction: - virtual void FileSelected(const FilePath& path, + virtual void FileSelected(const base::FilePath& path, int index, void* params) OVERRIDE; diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h index e18511e..5062ab4 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.h @@ -13,7 +13,6 @@ #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/media_gallery/media_galleries_preferences.h" -class FilePath; class Profile; namespace extensions { diff --git a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h index b193fae..b46543e 100644 --- a/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h +++ b/chrome/browser/extensions/api/media_galleries_private/media_galleries_private_event_router.h @@ -19,7 +19,6 @@ #include "chrome/browser/media_gallery/media_galleries_preferences.h" #include "chrome/browser/system_monitor/removable_storage_observer.h" -class FilePath; class Profile; namespace base { diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher.h b/chrome/browser/extensions/api/messaging/native_process_launcher.h index 41e735f..cbb9bd3 100644 --- a/chrome/browser/extensions/api/messaging/native_process_launcher.h +++ b/chrome/browser/extensions/api/messaging/native_process_launcher.h @@ -8,7 +8,9 @@ #include "base/process.h" #include "chrome/browser/extensions/api/messaging/native_message_process_host.h" +namespace base { class FilePath; +} namespace extensions { @@ -35,7 +37,7 @@ class NativeProcessLauncher { protected: static bool LaunchNativeProcess( - const FilePath& path, + const base::FilePath& path, base::ProcessHandle* native_process_handle, base::PlatformFile* read_file, base::PlatformFile* write_file); diff --git a/chrome/browser/extensions/api/page_capture/page_capture_api.h b/chrome/browser/extensions/api/page_capture/page_capture_api.h index 4d7e80f..e2d6ac4 100644 --- a/chrome/browser/extensions/api/page_capture/page_capture_api.h +++ b/chrome/browser/extensions/api/page_capture/page_capture_api.h @@ -12,7 +12,9 @@ #include "chrome/common/extensions/api/page_capture.h" #include "webkit/blob/shareable_file_reference.h" +namespace base { class FilePath; +} namespace content { class WebContents; @@ -29,7 +31,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction { public: // Called on the UI thread when the temporary file that contains the // generated data has been created. - virtual void OnTemporaryFileCreated(const FilePath& temp_file) = 0; + virtual void OnTemporaryFileCreated(const base::FilePath& temp_file) = 0; }; static void SetTestDelegate(TestDelegate* delegate); @@ -48,7 +50,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction { void ReturnSuccess(int64 file_size); // Callback called once the MHTML generation is done. - void MHTMLGenerated(const FilePath& file_path, int64 mhtml_file_size); + void MHTMLGenerated(const base::FilePath& file_path, int64 mhtml_file_size); // Returns the WebContents we are associated with, NULL if it's been closed. content::WebContents* GetWebContents(); @@ -56,7 +58,7 @@ class PageCaptureSaveAsMHTMLFunction : public AsyncExtensionFunction { scoped_ptr<extensions::api::page_capture::SaveAsMHTML::Params> params_; // The path to the temporary file containing the MHTML data. - FilePath mhtml_path_; + base::FilePath mhtml_path_; // The file containing the MHTML. scoped_refptr<webkit_blob::ShareableFileReference> mhtml_file_; diff --git a/chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.h b/chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.h index 8438b45..64909ac 100644 --- a/chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.h +++ b/chrome/browser/extensions/api/storage/sync_or_local_value_store_cache.h @@ -13,7 +13,9 @@ #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer.h" #include "chrome/browser/extensions/api/storage/value_store_cache.h" +namespace base { class FilePath; +} namespace extensions { @@ -30,7 +32,7 @@ class SyncOrLocalValueStoreCache : public ValueStoreCache { const scoped_refptr<SettingsStorageFactory>& factory, const SettingsStorageQuotaEnforcer::Limits& quota, const scoped_refptr<SettingsObserverList>& observers, - const FilePath& profile_path); + const base::FilePath& profile_path); virtual ~SyncOrLocalValueStoreCache(); SettingsBackend* GetAppBackend() const; @@ -48,7 +50,7 @@ class SyncOrLocalValueStoreCache : public ValueStoreCache { void InitOnFileThread(const scoped_refptr<SettingsStorageFactory>& factory, const SettingsStorageQuotaEnforcer::Limits& quota, const scoped_refptr<SettingsObserverList>& observers, - const FilePath& profile_path); + const base::FilePath& profile_path); settings_namespace::Namespace settings_namespace_; scoped_ptr<SettingsBackend> app_backend_; diff --git a/chrome/browser/extensions/app_notification_manager.h b/chrome/browser/extensions/app_notification_manager.h index 405b349..4fa6e30 100644 --- a/chrome/browser/extensions/app_notification_manager.h +++ b/chrome/browser/extensions/app_notification_manager.h @@ -119,7 +119,7 @@ class AppNotificationManager virtual ~AppNotificationManager(); // Starts loading storage_ using |storage_path|. - void LoadOnFileThread(const FilePath& storage_path); + void LoadOnFileThread(const base::FilePath& storage_path); // Called on the UI thread to handle the loaded results from storage_. void HandleLoadResults(NotificationMap* map); diff --git a/chrome/browser/extensions/app_notification_storage.h b/chrome/browser/extensions/app_notification_storage.h index 1daf6b2..5fda2fd 100644 --- a/chrome/browser/extensions/app_notification_storage.h +++ b/chrome/browser/extensions/app_notification_storage.h @@ -9,7 +9,9 @@ #include "chrome/browser/extensions/app_notification.h" +namespace base { class FilePath; +} namespace extensions { @@ -20,7 +22,7 @@ namespace extensions { class AppNotificationStorage { public: // Must be called on the FILE thread. The storage will be created at |path|. - static AppNotificationStorage* Create(const FilePath& path); + static AppNotificationStorage* Create(const base::FilePath& path); virtual ~AppNotificationStorage(); diff --git a/chrome/browser/extensions/convert_user_script.h b/chrome/browser/extensions/convert_user_script.h index fa02f90..b5937773 100644 --- a/chrome/browser/extensions/convert_user_script.h +++ b/chrome/browser/extensions/convert_user_script.h @@ -10,9 +10,12 @@ #include "base/memory/ref_counted.h" #include "base/string16.h" -class FilePath; class GURL; +namespace base { +class FilePath; +} + namespace extensions { class Extension; @@ -24,8 +27,8 @@ class Extension; // NOTE: The caller takes ownership of the directory at extension->path() on the // returned object. scoped_refptr<extensions::Extension> ConvertUserScriptToExtension( - const FilePath& user_script, const GURL& original_url, - const FilePath& extensions_dir, string16* error); + const base::FilePath& user_script, const GURL& original_url, + const base::FilePath& extensions_dir, string16* error); } // namespace extensions diff --git a/chrome/browser/extensions/convert_web_app.h b/chrome/browser/extensions/convert_web_app.h index 78d80f9..77c03d5 100644 --- a/chrome/browser/extensions/convert_web_app.h +++ b/chrome/browser/extensions/convert_web_app.h @@ -9,9 +9,8 @@ #include "base/memory/ref_counted.h" -class FilePath; - namespace base { +class FilePath; class Time; } @@ -41,7 +40,7 @@ std::string ConvertTimeToExtensionVersion(const base::Time& time); scoped_refptr<Extension> ConvertWebAppToExtension( const WebApplicationInfo& web_app_info, const base::Time& create_time, - const FilePath& extensions_dir); + const base::FilePath& extensions_dir); } // namespace extensions diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index 143f9fd..8d3d2e0 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h @@ -13,13 +13,14 @@ #include "chrome/browser/extensions/extension_browsertest.h" #include "content/public/browser/notification_registrar.h" +namespace base { class FilePath; +} namespace extensions { class Extension; } - // The general flow of these API tests should work like this: // (1) Setup initial browser state (e.g. create some bookmarks for the // bookmark test) @@ -158,7 +159,7 @@ class ExtensionApiTest : public ExtensionBrowserTest { // Start the test WebSocket server, and store details of its state. Those // details will be available to javascript tests using // chrome.test.getConfig(). - bool StartWebSocketServer(const FilePath& root_directory); + bool StartWebSocketServer(const base::FilePath& root_directory); // Test that exactly one extension loaded. If so, return a pointer to // the extension. If not, return NULL and set message_. diff --git a/chrome/browser/extensions/extension_creator.h b/chrome/browser/extensions/extension_creator.h index 86243ba..de7aa76 100644 --- a/chrome/browser/extensions/extension_creator.h +++ b/chrome/browser/extensions/extension_creator.h @@ -10,12 +10,14 @@ #include "base/basictypes.h" +namespace base { +class FilePath; +} + namespace crypto { class RSAPrivateKey; } -class FilePath; - namespace extensions { // This class create an installable extension (.crx file) given an input @@ -37,10 +39,10 @@ class ExtensionCreator { // Categories of error that may need special handling on the UI end. enum ErrorType { kOtherError, kCRXExists }; - bool Run(const FilePath& extension_dir, - const FilePath& crx_path, - const FilePath& private_key_path, - const FilePath& private_key_output_path, + bool Run(const base::FilePath& extension_dir, + const base::FilePath& crx_path, + const base::FilePath& private_key_path, + const base::FilePath& private_key_output_path, int run_flags); // Returns the error message that will be present if Run(...) returned false. @@ -56,38 +58,38 @@ class ExtensionCreator { // the extension. If not provided, a random key will be created (in which case // it is written to |private_key_output_path| -- if provided). // |flags| is a bitset of RunFlags values. - bool InitializeInput(const FilePath& extension_dir, - const FilePath& crx_path, - const FilePath& private_key_path, - const FilePath& private_key_output_path, + bool InitializeInput(const base::FilePath& extension_dir, + const base::FilePath& crx_path, + const base::FilePath& private_key_path, + const base::FilePath& private_key_output_path, int run_flags); // Validates the manifest by trying to load the extension. - bool ValidateManifest(const FilePath& extension_dir, + bool ValidateManifest(const base::FilePath& extension_dir, crypto::RSAPrivateKey* key_pair, int run_flags); // Reads private key from |private_key_path|. - crypto::RSAPrivateKey* ReadInputKey(const FilePath& private_key_path); + crypto::RSAPrivateKey* ReadInputKey(const base::FilePath& private_key_path); // Generates a key pair and writes the private key to |private_key_path| // if provided. - crypto::RSAPrivateKey* GenerateKey(const FilePath& private_key_path); + crypto::RSAPrivateKey* GenerateKey(const base::FilePath& private_key_path); // Creates temporary zip file for the extension. - bool CreateZip(const FilePath& extension_dir, const FilePath& temp_path, - FilePath* zip_path); + bool CreateZip(const base::FilePath& extension_dir, const base::FilePath& temp_path, + base::FilePath* zip_path); // Signs the temporary zip and returns the signature. - bool SignZip(const FilePath& zip_path, + bool SignZip(const base::FilePath& zip_path, crypto::RSAPrivateKey* private_key, std::vector<uint8>* signature); // Export installable .crx to |crx_path|. - bool WriteCRX(const FilePath& zip_path, + bool WriteCRX(const base::FilePath& zip_path, crypto::RSAPrivateKey* private_key, const std::vector<uint8>& signature, - const FilePath& crx_path); + const base::FilePath& crx_path); // Holds a message for any error that is raised during Run(...). std::string error_message_; diff --git a/chrome/browser/extensions/extension_creator_filter.h b/chrome/browser/extensions/extension_creator_filter.h index c13e2c2..6c0aac6 100644 --- a/chrome/browser/extensions/extension_creator_filter.h +++ b/chrome/browser/extensions/extension_creator_filter.h @@ -7,7 +7,9 @@ #include "base/memory/ref_counted.h" +namespace base { class FilePath; +} namespace extensions { @@ -18,9 +20,9 @@ class ExtensionCreatorFilter public: ExtensionCreatorFilter() {} - // Returns true if the given FilePath should be included in a + // Returns true if the given base::FilePath should be included in a // packed extension. - bool ShouldPackageFile(const FilePath& file_path); + bool ShouldPackageFile(const base::FilePath& file_path); private: friend class base::RefCounted<ExtensionCreatorFilter>; diff --git a/chrome/browser/extensions/external_provider_interface.h b/chrome/browser/extensions/external_provider_interface.h index 1d1f098..2017386 100644 --- a/chrome/browser/extensions/external_provider_interface.h +++ b/chrome/browser/extensions/external_provider_interface.h @@ -10,10 +10,13 @@ #include "base/memory/linked_ptr.h" #include "chrome/common/extensions/manifest.h" -class FilePath; class GURL; class Version; +namespace base { +class FilePath; +} + namespace extensions { // This class is an abstract class for implementing external extensions @@ -33,7 +36,7 @@ class ExternalProviderInterface { virtual bool OnExternalExtensionFileFound( const std::string& id, const Version* version, - const FilePath& path, + const base::FilePath& path, Manifest::Location location, int creation_flags, bool mark_acknowledged) = 0; diff --git a/chrome/browser/extensions/platform_app_launcher.h b/chrome/browser/extensions/platform_app_launcher.h index 9665641..ae9cfa5 100644 --- a/chrome/browser/extensions/platform_app_launcher.h +++ b/chrome/browser/extensions/platform_app_launcher.h @@ -8,9 +8,12 @@ #include <string> class CommandLine; -class FilePath; class Profile; +namespace base { +class FilePath; +} + namespace content { class WebContents; class WebIntentsDispatcher; @@ -27,20 +30,20 @@ class Extension; void LaunchPlatformApp(Profile* profile, const Extension* extension, const CommandLine* command_line, - const FilePath& current_directory); + const base::FilePath& current_directory); // Launches the platform app |extension| with the contents of |file_path| // available through the launch data. void LaunchPlatformAppWithPath(Profile* profile, const Extension* extension, - const FilePath& file_path); + const base::FilePath& file_path); // Launches the platform app |extension| with the contents of |file_path| // available through the launch data. void LaunchPlatformAppWithFileHandler(Profile* profile, const Extension* extension, const std::string& handler_id, - const FilePath& file_path); + const base::FilePath& file_path); #if defined(ENABLE_WEB_INTENTS) // Launches the platform app |extension| with the supplied web intent. Creates diff --git a/chrome/browser/extensions/test_extension_system.h b/chrome/browser/extensions/test_extension_system.h index 47faa2f..d17ac02 100644 --- a/chrome/browser/extensions/test_extension_system.h +++ b/chrome/browser/extensions/test_extension_system.h @@ -8,8 +8,9 @@ #include "chrome/browser/extensions/extension_system.h" class CommandLine; -class FilePath; + namespace base { +class FilePath; class Time; } @@ -27,7 +28,7 @@ class TestExtensionSystem : public ExtensionSystem { // Creates an ExtensionService initialized with the testing profile and // returns it. ExtensionService* CreateExtensionService(const CommandLine* command_line, - const FilePath& install_directory, + const base::FilePath& install_directory, bool autoupdate_enabled); // Creates an ExtensionProcessManager. If not invoked, the diff --git a/chrome/browser/extensions/updater/extension_downloader_delegate.h b/chrome/browser/extensions/updater/extension_downloader_delegate.h index dd0b6c1..58e0dc9 100644 --- a/chrome/browser/extensions/updater/extension_downloader_delegate.h +++ b/chrome/browser/extensions/updater/extension_downloader_delegate.h @@ -11,9 +11,12 @@ #include "base/time.h" #include "chrome/browser/extensions/updater/manifest_fetch_data.h" -class FilePath; class GURL; +namespace base { +class FilePath; +} + namespace extensions { class ExtensionDownloaderDelegate { @@ -80,7 +83,7 @@ class ExtensionDownloaderDelegate { // to the delegate. virtual void OnExtensionDownloadFinished( const std::string& id, - const FilePath& path, + const base::FilePath& path, const GURL& download_url, const std::string& version, const PingResult& ping_result, diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h index b263f81..bda4aa0 100644 --- a/chrome/browser/extensions/webstore_installer.h +++ b/chrome/browser/extensions/webstore_installer.h @@ -21,9 +21,12 @@ #include "googleurl/src/gurl.h" #include "net/base/net_errors.h" -class FilePath; class Profile; +namespace base { +class FilePath; +} + namespace content { class NavigationController; } @@ -142,7 +145,7 @@ class WebstoreInstaller :public content::NotificationObserver, // Instead of using the default download directory, use |directory| instead. // This does *not* transfer ownership of |directory|. - static void SetDownloadDirectoryForTests(FilePath* directory); + static void SetDownloadDirectoryForTests(base::FilePath* directory); private: friend struct content::BrowserThread::DeleteOnThread< @@ -158,7 +161,7 @@ class WebstoreInstaller :public content::NotificationObserver, virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; // Starts downloading the extension to |file_path|. - void StartDownload(const FilePath& file_path); + void StartDownload(const base::FilePath& file_path); // Reports an install |error| to the delegate for the given extension if this // managed its installation. This also removes the associated PendingInstall. |