OLD | NEW |
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 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 typedef std::vector<linked_ptr<developer::ItemInfo> > ItemInfoList; | 56 typedef std::vector<linked_ptr<developer::ItemInfo> > ItemInfoList; |
57 typedef std::vector<linked_ptr<developer::ProjectInfo> > ProjectInfoList; | 57 typedef std::vector<linked_ptr<developer::ProjectInfo> > ProjectInfoList; |
58 typedef std::vector<linked_ptr<developer::ItemInspectView> > | 58 typedef std::vector<linked_ptr<developer::ItemInspectView> > |
59 ItemInspectViewList; | 59 ItemInspectViewList; |
60 | 60 |
61 class DeveloperPrivateEventRouter : public content::NotificationObserver, | 61 class DeveloperPrivateEventRouter : public content::NotificationObserver, |
62 public ExtensionRegistryObserver, | 62 public ExtensionRegistryObserver, |
63 public ErrorConsole::Observer { | 63 public ErrorConsole::Observer { |
64 public: | 64 public: |
65 explicit DeveloperPrivateEventRouter(Profile* profile); | 65 explicit DeveloperPrivateEventRouter(Profile* profile); |
66 virtual ~DeveloperPrivateEventRouter(); | 66 ~DeveloperPrivateEventRouter() override; |
67 | 67 |
68 // Add or remove an ID to the list of extensions subscribed to events. | 68 // Add or remove an ID to the list of extensions subscribed to events. |
69 void AddExtensionId(const std::string& extension_id); | 69 void AddExtensionId(const std::string& extension_id); |
70 void RemoveExtensionId(const std::string& extension_id); | 70 void RemoveExtensionId(const std::string& extension_id); |
71 | 71 |
72 private: | 72 private: |
73 // content::NotificationObserver implementation. | 73 // content::NotificationObserver implementation. |
74 virtual void Observe(int type, | 74 void Observe(int type, |
75 const content::NotificationSource& source, | 75 const content::NotificationSource& source, |
76 const content::NotificationDetails& details) override; | 76 const content::NotificationDetails& details) override; |
77 | 77 |
78 // ExtensionRegistryObserver implementation. | 78 // ExtensionRegistryObserver implementation. |
79 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 79 void OnExtensionLoaded(content::BrowserContext* browser_context, |
80 const Extension* extension) override; | 80 const Extension* extension) override; |
81 virtual void OnExtensionUnloaded( | 81 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
82 content::BrowserContext* browser_context, | 82 const Extension* extension, |
83 const Extension* extension, | 83 UnloadedExtensionInfo::Reason reason) override; |
84 UnloadedExtensionInfo::Reason reason) override; | 84 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, |
85 virtual void OnExtensionWillBeInstalled( | 85 const Extension* extension, |
86 content::BrowserContext* browser_context, | 86 bool is_update, |
87 const Extension* extension, | 87 bool from_ephemeral, |
88 bool is_update, | 88 const std::string& old_name) override; |
89 bool from_ephemeral, | 89 void OnExtensionUninstalled(content::BrowserContext* browser_context, |
90 const std::string& old_name) override; | 90 const Extension* extension, |
91 virtual void OnExtensionUninstalled( | 91 extensions::UninstallReason reason) override; |
92 content::BrowserContext* browser_context, | |
93 const Extension* extension, | |
94 extensions::UninstallReason reason) override; | |
95 | 92 |
96 // ErrorConsole::Observer implementation. | 93 // ErrorConsole::Observer implementation. |
97 virtual void OnErrorAdded(const ExtensionError* error) override; | 94 void OnErrorAdded(const ExtensionError* error) override; |
98 | 95 |
99 content::NotificationRegistrar registrar_; | 96 content::NotificationRegistrar registrar_; |
100 | 97 |
101 ScopedObserver<extensions::ExtensionRegistry, | 98 ScopedObserver<extensions::ExtensionRegistry, |
102 extensions::ExtensionRegistryObserver> | 99 extensions::ExtensionRegistryObserver> |
103 extension_registry_observer_; | 100 extension_registry_observer_; |
104 | 101 |
105 Profile* profile_; | 102 Profile* profile_; |
106 | 103 |
107 // The set of IDs of the Extensions that have subscribed to DeveloperPrivate | 104 // The set of IDs of the Extensions that have subscribed to DeveloperPrivate |
(...skipping 11 matching lines...) Expand all Loading... |
119 class DeveloperPrivateAPI : public BrowserContextKeyedAPI, | 116 class DeveloperPrivateAPI : public BrowserContextKeyedAPI, |
120 public EventRouter::Observer { | 117 public EventRouter::Observer { |
121 public: | 118 public: |
122 static BrowserContextKeyedAPIFactory<DeveloperPrivateAPI>* | 119 static BrowserContextKeyedAPIFactory<DeveloperPrivateAPI>* |
123 GetFactoryInstance(); | 120 GetFactoryInstance(); |
124 | 121 |
125 // Convenience method to get the DeveloperPrivateAPI for a profile. | 122 // Convenience method to get the DeveloperPrivateAPI for a profile. |
126 static DeveloperPrivateAPI* Get(content::BrowserContext* context); | 123 static DeveloperPrivateAPI* Get(content::BrowserContext* context); |
127 | 124 |
128 explicit DeveloperPrivateAPI(content::BrowserContext* context); | 125 explicit DeveloperPrivateAPI(content::BrowserContext* context); |
129 virtual ~DeveloperPrivateAPI(); | 126 ~DeveloperPrivateAPI() override; |
130 | 127 |
131 void SetLastUnpackedDirectory(const base::FilePath& path); | 128 void SetLastUnpackedDirectory(const base::FilePath& path); |
132 | 129 |
133 base::FilePath& GetLastUnpackedDirectory() { | 130 base::FilePath& GetLastUnpackedDirectory() { |
134 return last_unpacked_directory_; | 131 return last_unpacked_directory_; |
135 } | 132 } |
136 | 133 |
137 // KeyedService implementation | 134 // KeyedService implementation |
138 virtual void Shutdown() override; | 135 void Shutdown() override; |
139 | 136 |
140 // EventRouter::Observer implementation. | 137 // EventRouter::Observer implementation. |
141 virtual void OnListenerAdded(const EventListenerInfo& details) override; | 138 void OnListenerAdded(const EventListenerInfo& details) override; |
142 virtual void OnListenerRemoved(const EventListenerInfo& details) override; | 139 void OnListenerRemoved(const EventListenerInfo& details) override; |
143 | 140 |
144 private: | 141 private: |
145 friend class BrowserContextKeyedAPIFactory<DeveloperPrivateAPI>; | 142 friend class BrowserContextKeyedAPIFactory<DeveloperPrivateAPI>; |
146 | 143 |
147 // BrowserContextKeyedAPI implementation. | 144 // BrowserContextKeyedAPI implementation. |
148 static const char* service_name() { return "DeveloperPrivateAPI"; } | 145 static const char* service_name() { return "DeveloperPrivateAPI"; } |
149 static const bool kServiceRedirectedInIncognito = true; | 146 static const bool kServiceRedirectedInIncognito = true; |
150 static const bool kServiceIsNULLWhileTesting = true; | 147 static const bool kServiceIsNULLWhileTesting = true; |
151 | 148 |
152 void RegisterNotifications(); | 149 void RegisterNotifications(); |
(...skipping 11 matching lines...) Expand all Loading... |
164 }; | 161 }; |
165 | 162 |
166 namespace api { | 163 namespace api { |
167 | 164 |
168 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { | 165 class DeveloperPrivateAutoUpdateFunction : public ChromeSyncExtensionFunction { |
169 public: | 166 public: |
170 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", | 167 DECLARE_EXTENSION_FUNCTION("developerPrivate.autoUpdate", |
171 DEVELOPERPRIVATE_AUTOUPDATE) | 168 DEVELOPERPRIVATE_AUTOUPDATE) |
172 | 169 |
173 protected: | 170 protected: |
174 virtual ~DeveloperPrivateAutoUpdateFunction(); | 171 ~DeveloperPrivateAutoUpdateFunction() override; |
175 | 172 |
176 // ExtensionFunction: | 173 // ExtensionFunction: |
177 virtual bool RunSync() override; | 174 bool RunSync() override; |
178 }; | 175 }; |
179 | 176 |
180 class DeveloperPrivateGetItemsInfoFunction | 177 class DeveloperPrivateGetItemsInfoFunction |
181 : public ChromeAsyncExtensionFunction { | 178 : public ChromeAsyncExtensionFunction { |
182 public: | 179 public: |
183 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", | 180 DECLARE_EXTENSION_FUNCTION("developerPrivate.getItemsInfo", |
184 DEVELOPERPRIVATE_GETITEMSINFO) | 181 DEVELOPERPRIVATE_GETITEMSINFO) |
185 | 182 |
186 protected: | 183 protected: |
187 virtual ~DeveloperPrivateGetItemsInfoFunction(); | 184 ~DeveloperPrivateGetItemsInfoFunction() override; |
188 | 185 |
189 // ExtensionFunction: | 186 // ExtensionFunction: |
190 virtual bool RunAsync() override; | 187 bool RunAsync() override; |
191 | 188 |
192 private: | 189 private: |
193 scoped_ptr<developer::ItemInfo> CreateItemInfo(const Extension& item, | 190 scoped_ptr<developer::ItemInfo> CreateItemInfo(const Extension& item, |
194 bool item_is_enabled); | 191 bool item_is_enabled); |
195 | 192 |
196 void GetIconsOnFileThread( | 193 void GetIconsOnFileThread( |
197 ItemInfoList item_list, | 194 ItemInfoList item_list, |
198 std::map<std::string, ExtensionResource> itemIdToIconResourceMap); | 195 std::map<std::string, ExtensionResource> itemIdToIconResourceMap); |
199 | 196 |
200 // Helper that lists the current inspectable html pages for the extension. | 197 // Helper that lists the current inspectable html pages for the extension. |
(...skipping 16 matching lines...) Expand all Loading... |
217 bool incognito, | 214 bool incognito, |
218 bool generated_background_page); | 215 bool generated_background_page); |
219 }; | 216 }; |
220 | 217 |
221 class DeveloperPrivateInspectFunction : public ChromeSyncExtensionFunction { | 218 class DeveloperPrivateInspectFunction : public ChromeSyncExtensionFunction { |
222 public: | 219 public: |
223 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", | 220 DECLARE_EXTENSION_FUNCTION("developerPrivate.inspect", |
224 DEVELOPERPRIVATE_INSPECT) | 221 DEVELOPERPRIVATE_INSPECT) |
225 | 222 |
226 protected: | 223 protected: |
227 virtual ~DeveloperPrivateInspectFunction(); | 224 ~DeveloperPrivateInspectFunction() override; |
228 | 225 |
229 // ExtensionFunction: | 226 // ExtensionFunction: |
230 virtual bool RunSync() override; | 227 bool RunSync() override; |
231 }; | 228 }; |
232 | 229 |
233 class DeveloperPrivateAllowFileAccessFunction | 230 class DeveloperPrivateAllowFileAccessFunction |
234 : public ChromeSyncExtensionFunction { | 231 : public ChromeSyncExtensionFunction { |
235 public: | 232 public: |
236 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess", | 233 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowFileAccess", |
237 DEVELOPERPRIVATE_ALLOWFILEACCESS); | 234 DEVELOPERPRIVATE_ALLOWFILEACCESS); |
238 | 235 |
239 protected: | 236 protected: |
240 virtual ~DeveloperPrivateAllowFileAccessFunction(); | 237 ~DeveloperPrivateAllowFileAccessFunction() override; |
241 | 238 |
242 // ExtensionFunction: | 239 // ExtensionFunction: |
243 virtual bool RunSync() override; | 240 bool RunSync() override; |
244 }; | 241 }; |
245 | 242 |
246 class DeveloperPrivateAllowIncognitoFunction | 243 class DeveloperPrivateAllowIncognitoFunction |
247 : public ChromeSyncExtensionFunction { | 244 : public ChromeSyncExtensionFunction { |
248 public: | 245 public: |
249 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito", | 246 DECLARE_EXTENSION_FUNCTION("developerPrivate.allowIncognito", |
250 DEVELOPERPRIVATE_ALLOWINCOGNITO); | 247 DEVELOPERPRIVATE_ALLOWINCOGNITO); |
251 | 248 |
252 protected: | 249 protected: |
253 virtual ~DeveloperPrivateAllowIncognitoFunction(); | 250 ~DeveloperPrivateAllowIncognitoFunction() override; |
254 | 251 |
255 // ExtensionFunction: | 252 // ExtensionFunction: |
256 virtual bool RunSync() override; | 253 bool RunSync() override; |
257 }; | 254 }; |
258 | 255 |
259 class DeveloperPrivateReloadFunction : public ChromeSyncExtensionFunction { | 256 class DeveloperPrivateReloadFunction : public ChromeSyncExtensionFunction { |
260 public: | 257 public: |
261 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload", | 258 DECLARE_EXTENSION_FUNCTION("developerPrivate.reload", |
262 DEVELOPERPRIVATE_RELOAD); | 259 DEVELOPERPRIVATE_RELOAD); |
263 | 260 |
264 protected: | 261 protected: |
265 virtual ~DeveloperPrivateReloadFunction(); | 262 ~DeveloperPrivateReloadFunction() override; |
266 | 263 |
267 // ExtensionFunction: | 264 // ExtensionFunction: |
268 virtual bool RunSync() override; | 265 bool RunSync() override; |
269 }; | 266 }; |
270 | 267 |
271 class DeveloperPrivateShowPermissionsDialogFunction | 268 class DeveloperPrivateShowPermissionsDialogFunction |
272 : public ChromeSyncExtensionFunction, | 269 : public ChromeSyncExtensionFunction, |
273 public ExtensionInstallPrompt::Delegate { | 270 public ExtensionInstallPrompt::Delegate { |
274 public: | 271 public: |
275 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", | 272 DECLARE_EXTENSION_FUNCTION("developerPrivate.showPermissionsDialog", |
276 DEVELOPERPRIVATE_PERMISSIONS); | 273 DEVELOPERPRIVATE_PERMISSIONS); |
277 | 274 |
278 DeveloperPrivateShowPermissionsDialogFunction(); | 275 DeveloperPrivateShowPermissionsDialogFunction(); |
279 protected: | 276 protected: |
280 virtual ~DeveloperPrivateShowPermissionsDialogFunction(); | 277 ~DeveloperPrivateShowPermissionsDialogFunction() override; |
281 | 278 |
282 // ExtensionFunction: | 279 // ExtensionFunction: |
283 virtual bool RunSync() override; | 280 bool RunSync() override; |
284 | 281 |
285 // Overridden from ExtensionInstallPrompt::Delegate | 282 // Overridden from ExtensionInstallPrompt::Delegate |
286 virtual void InstallUIProceed() override; | 283 void InstallUIProceed() override; |
287 virtual void InstallUIAbort(bool user_initiated) override; | 284 void InstallUIAbort(bool user_initiated) override; |
288 | 285 |
289 scoped_ptr<ExtensionInstallPrompt> prompt_; | 286 scoped_ptr<ExtensionInstallPrompt> prompt_; |
290 std::string extension_id_; | 287 std::string extension_id_; |
291 }; | 288 }; |
292 | 289 |
293 class DeveloperPrivateEnableFunction | 290 class DeveloperPrivateEnableFunction |
294 : public ChromeSyncExtensionFunction, | 291 : public ChromeSyncExtensionFunction, |
295 public base::SupportsWeakPtr<DeveloperPrivateEnableFunction> { | 292 public base::SupportsWeakPtr<DeveloperPrivateEnableFunction> { |
296 public: | 293 public: |
297 DECLARE_EXTENSION_FUNCTION("developerPrivate.enable", | 294 DECLARE_EXTENSION_FUNCTION("developerPrivate.enable", |
298 DEVELOPERPRIVATE_ENABLE); | 295 DEVELOPERPRIVATE_ENABLE); |
299 | 296 |
300 DeveloperPrivateEnableFunction(); | 297 DeveloperPrivateEnableFunction(); |
301 | 298 |
302 protected: | 299 protected: |
303 virtual ~DeveloperPrivateEnableFunction(); | 300 ~DeveloperPrivateEnableFunction() override; |
304 | 301 |
305 // Callback for requirements checker. | 302 // Callback for requirements checker. |
306 void OnRequirementsChecked(const std::string& extension_id, | 303 void OnRequirementsChecked(const std::string& extension_id, |
307 std::vector<std::string> requirements_errors); | 304 std::vector<std::string> requirements_errors); |
308 // ExtensionFunction: | 305 // ExtensionFunction: |
309 virtual bool RunSync() override; | 306 bool RunSync() override; |
310 | 307 |
311 private: | 308 private: |
312 scoped_ptr<RequirementsChecker> requirements_checker_; | 309 scoped_ptr<RequirementsChecker> requirements_checker_; |
313 }; | 310 }; |
314 | 311 |
315 class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction, | 312 class DeveloperPrivateChooseEntryFunction : public ChromeAsyncExtensionFunction, |
316 public EntryPickerClient { | 313 public EntryPickerClient { |
317 protected: | 314 protected: |
318 virtual ~DeveloperPrivateChooseEntryFunction(); | 315 ~DeveloperPrivateChooseEntryFunction() override; |
319 virtual bool RunAsync() override; | 316 bool RunAsync() override; |
320 bool ShowPicker(ui::SelectFileDialog::Type picker_type, | 317 bool ShowPicker(ui::SelectFileDialog::Type picker_type, |
321 const base::FilePath& last_directory, | 318 const base::FilePath& last_directory, |
322 const base::string16& select_title, | 319 const base::string16& select_title, |
323 const ui::SelectFileDialog::FileTypeInfo& info, | 320 const ui::SelectFileDialog::FileTypeInfo& info, |
324 int file_type_index); | 321 int file_type_index); |
325 | 322 |
326 // EntryPickerClient functions. | 323 // EntryPickerClient functions. |
327 virtual void FileSelected(const base::FilePath& path) = 0; | 324 virtual void FileSelected(const base::FilePath& path) = 0; |
328 virtual void FileSelectionCanceled() = 0; | 325 virtual void FileSelectionCanceled() = 0; |
329 }; | 326 }; |
330 | 327 |
331 | 328 |
332 class DeveloperPrivateLoadUnpackedFunction | 329 class DeveloperPrivateLoadUnpackedFunction |
333 : public DeveloperPrivateChooseEntryFunction { | 330 : public DeveloperPrivateChooseEntryFunction { |
334 public: | 331 public: |
335 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadUnpacked", | 332 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadUnpacked", |
336 DEVELOPERPRIVATE_LOADUNPACKED); | 333 DEVELOPERPRIVATE_LOADUNPACKED); |
337 | 334 |
338 protected: | 335 protected: |
339 virtual ~DeveloperPrivateLoadUnpackedFunction(); | 336 ~DeveloperPrivateLoadUnpackedFunction() override; |
340 virtual bool RunAsync() override; | 337 bool RunAsync() override; |
341 | 338 |
342 // EntryPickerCLient implementation. | 339 // EntryPickerCLient implementation. |
343 virtual void FileSelected(const base::FilePath& path) override; | 340 void FileSelected(const base::FilePath& path) override; |
344 virtual void FileSelectionCanceled() override; | 341 void FileSelectionCanceled() override; |
345 }; | 342 }; |
346 | 343 |
347 class DeveloperPrivateChoosePathFunction | 344 class DeveloperPrivateChoosePathFunction |
348 : public DeveloperPrivateChooseEntryFunction { | 345 : public DeveloperPrivateChooseEntryFunction { |
349 public: | 346 public: |
350 DECLARE_EXTENSION_FUNCTION("developerPrivate.choosePath", | 347 DECLARE_EXTENSION_FUNCTION("developerPrivate.choosePath", |
351 DEVELOPERPRIVATE_CHOOSEPATH); | 348 DEVELOPERPRIVATE_CHOOSEPATH); |
352 | 349 |
353 protected: | 350 protected: |
354 virtual ~DeveloperPrivateChoosePathFunction(); | 351 ~DeveloperPrivateChoosePathFunction() override; |
355 virtual bool RunAsync() override; | 352 bool RunAsync() override; |
356 | 353 |
357 // EntryPickerClient functions. | 354 // EntryPickerClient functions. |
358 virtual void FileSelected(const base::FilePath& path) override; | 355 void FileSelected(const base::FilePath& path) override; |
359 virtual void FileSelectionCanceled() override; | 356 void FileSelectionCanceled() override; |
360 }; | 357 }; |
361 | 358 |
362 class DeveloperPrivatePackDirectoryFunction | 359 class DeveloperPrivatePackDirectoryFunction |
363 : public ChromeAsyncExtensionFunction, | 360 : public ChromeAsyncExtensionFunction, |
364 public PackExtensionJob::Client { | 361 public PackExtensionJob::Client { |
365 | 362 |
366 public: | 363 public: |
367 DECLARE_EXTENSION_FUNCTION("developerPrivate.packDirectory", | 364 DECLARE_EXTENSION_FUNCTION("developerPrivate.packDirectory", |
368 DEVELOPERPRIVATE_PACKDIRECTORY); | 365 DEVELOPERPRIVATE_PACKDIRECTORY); |
369 | 366 |
370 DeveloperPrivatePackDirectoryFunction(); | 367 DeveloperPrivatePackDirectoryFunction(); |
371 | 368 |
372 // ExtensionPackJob::Client implementation. | 369 // ExtensionPackJob::Client implementation. |
373 virtual void OnPackSuccess(const base::FilePath& crx_file, | 370 void OnPackSuccess(const base::FilePath& crx_file, |
374 const base::FilePath& key_file) override; | 371 const base::FilePath& key_file) override; |
375 virtual void OnPackFailure(const std::string& error, | 372 void OnPackFailure(const std::string& error, |
376 ExtensionCreator::ErrorType error_type) override; | 373 ExtensionCreator::ErrorType error_type) override; |
377 | 374 |
378 protected: | 375 protected: |
379 virtual ~DeveloperPrivatePackDirectoryFunction(); | 376 ~DeveloperPrivatePackDirectoryFunction() override; |
380 virtual bool RunAsync() override; | 377 bool RunAsync() override; |
381 | 378 |
382 private: | 379 private: |
383 scoped_refptr<PackExtensionJob> pack_job_; | 380 scoped_refptr<PackExtensionJob> pack_job_; |
384 std::string item_path_str_; | 381 std::string item_path_str_; |
385 std::string key_path_str_; | 382 std::string key_path_str_; |
386 }; | 383 }; |
387 | 384 |
388 class DeveloperPrivateIsProfileManagedFunction | 385 class DeveloperPrivateIsProfileManagedFunction |
389 : public ChromeSyncExtensionFunction { | 386 : public ChromeSyncExtensionFunction { |
390 public: | 387 public: |
391 DECLARE_EXTENSION_FUNCTION("developerPrivate.isProfileManaged", | 388 DECLARE_EXTENSION_FUNCTION("developerPrivate.isProfileManaged", |
392 DEVELOPERPRIVATE_ISPROFILEMANAGED); | 389 DEVELOPERPRIVATE_ISPROFILEMANAGED); |
393 | 390 |
394 protected: | 391 protected: |
395 virtual ~DeveloperPrivateIsProfileManagedFunction(); | 392 ~DeveloperPrivateIsProfileManagedFunction() override; |
396 | 393 |
397 // ExtensionFunction: | 394 // ExtensionFunction: |
398 virtual bool RunSync() override; | 395 bool RunSync() override; |
399 }; | 396 }; |
400 | 397 |
401 class DeveloperPrivateLoadDirectoryFunction | 398 class DeveloperPrivateLoadDirectoryFunction |
402 : public ChromeAsyncExtensionFunction { | 399 : public ChromeAsyncExtensionFunction { |
403 public: | 400 public: |
404 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadDirectory", | 401 DECLARE_EXTENSION_FUNCTION("developerPrivate.loadDirectory", |
405 DEVELOPERPRIVATE_LOADUNPACKEDCROS); | 402 DEVELOPERPRIVATE_LOADUNPACKEDCROS); |
406 | 403 |
407 DeveloperPrivateLoadDirectoryFunction(); | 404 DeveloperPrivateLoadDirectoryFunction(); |
408 | 405 |
409 protected: | 406 protected: |
410 virtual ~DeveloperPrivateLoadDirectoryFunction(); | 407 ~DeveloperPrivateLoadDirectoryFunction() override; |
411 | 408 |
412 // ExtensionFunction: | 409 // ExtensionFunction: |
413 virtual bool RunAsync() override; | 410 bool RunAsync() override; |
414 | 411 |
415 bool LoadByFileSystemAPI(const storage::FileSystemURL& directory_url); | 412 bool LoadByFileSystemAPI(const storage::FileSystemURL& directory_url); |
416 | 413 |
417 void ClearExistingDirectoryContent(const base::FilePath& project_path); | 414 void ClearExistingDirectoryContent(const base::FilePath& project_path); |
418 | 415 |
419 void ReadDirectoryByFileSystemAPI(const base::FilePath& project_path, | 416 void ReadDirectoryByFileSystemAPI(const base::FilePath& project_path, |
420 const base::FilePath& destination_path); | 417 const base::FilePath& destination_path); |
421 | 418 |
422 void ReadDirectoryByFileSystemAPICb( | 419 void ReadDirectoryByFileSystemAPICb( |
423 const base::FilePath& project_path, | 420 const base::FilePath& project_path, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 453 |
457 class DeveloperPrivateRequestFileSourceFunction | 454 class DeveloperPrivateRequestFileSourceFunction |
458 : public ChromeAsyncExtensionFunction { | 455 : public ChromeAsyncExtensionFunction { |
459 public: | 456 public: |
460 DECLARE_EXTENSION_FUNCTION("developerPrivate.requestFileSource", | 457 DECLARE_EXTENSION_FUNCTION("developerPrivate.requestFileSource", |
461 DEVELOPERPRIVATE_REQUESTFILESOURCE); | 458 DEVELOPERPRIVATE_REQUESTFILESOURCE); |
462 | 459 |
463 DeveloperPrivateRequestFileSourceFunction(); | 460 DeveloperPrivateRequestFileSourceFunction(); |
464 | 461 |
465 protected: | 462 protected: |
466 virtual ~DeveloperPrivateRequestFileSourceFunction(); | 463 ~DeveloperPrivateRequestFileSourceFunction() override; |
467 | 464 |
468 // ExtensionFunction: | 465 // ExtensionFunction: |
469 virtual bool RunAsync() override; | 466 bool RunAsync() override; |
470 | 467 |
471 private: | 468 private: |
472 void LaunchCallback(const base::DictionaryValue& results); | 469 void LaunchCallback(const base::DictionaryValue& results); |
473 }; | 470 }; |
474 | 471 |
475 class DeveloperPrivateOpenDevToolsFunction | 472 class DeveloperPrivateOpenDevToolsFunction |
476 : public ChromeAsyncExtensionFunction { | 473 : public ChromeAsyncExtensionFunction { |
477 public: | 474 public: |
478 DECLARE_EXTENSION_FUNCTION("developerPrivate.openDevTools", | 475 DECLARE_EXTENSION_FUNCTION("developerPrivate.openDevTools", |
479 DEVELOPERPRIVATE_OPENDEVTOOLS); | 476 DEVELOPERPRIVATE_OPENDEVTOOLS); |
480 | 477 |
481 DeveloperPrivateOpenDevToolsFunction(); | 478 DeveloperPrivateOpenDevToolsFunction(); |
482 | 479 |
483 protected: | 480 protected: |
484 virtual ~DeveloperPrivateOpenDevToolsFunction(); | 481 ~DeveloperPrivateOpenDevToolsFunction() override; |
485 | 482 |
486 // ExtensionFunction: | 483 // ExtensionFunction: |
487 virtual bool RunAsync() override; | 484 bool RunAsync() override; |
488 }; | 485 }; |
489 | 486 |
490 } // namespace api | 487 } // namespace api |
491 | 488 |
492 } // namespace extensions | 489 } // namespace extensions |
493 | 490 |
494 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ | 491 #endif // CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API
_H_ |
OLD | NEW |