OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 public ExtensionErrorReporter::Observer, | 35 public ExtensionErrorReporter::Observer, |
36 public content::WebContentsObserver { | 36 public content::WebContentsObserver { |
37 public: | 37 public: |
38 explicit ExtensionLoaderHandler(Profile* profile); | 38 explicit ExtensionLoaderHandler(Profile* profile); |
39 virtual ~ExtensionLoaderHandler(); | 39 virtual ~ExtensionLoaderHandler(); |
40 | 40 |
41 // Fetches the localized values for the page and deposits them into |source|. | 41 // Fetches the localized values for the page and deposits them into |source|. |
42 void GetLocalizedValues(content::WebUIDataSource* source); | 42 void GetLocalizedValues(content::WebUIDataSource* source); |
43 | 43 |
44 // WebUIMessageHandler implementation. | 44 // WebUIMessageHandler implementation. |
45 virtual void RegisterMessages() OVERRIDE; | 45 virtual void RegisterMessages() override; |
46 | 46 |
47 private: | 47 private: |
48 class FileHelper; | 48 class FileHelper; |
49 | 49 |
50 // Handle the 'extensionLoaderLoadUnpacked' message. | 50 // Handle the 'extensionLoaderLoadUnpacked' message. |
51 void HandleLoadUnpacked(const base::ListValue* args); | 51 void HandleLoadUnpacked(const base::ListValue* args); |
52 | 52 |
53 // Handle the 'extensionLoaderRetry' message. | 53 // Handle the 'extensionLoaderRetry' message. |
54 void HandleRetry(const base::ListValue* args); | 54 void HandleRetry(const base::ListValue* args); |
55 | 55 |
56 // Handle the 'extensionLoaderIgnoreFailure' message. | 56 // Handle the 'extensionLoaderIgnoreFailure' message. |
57 void HandleIgnoreFailure(const base::ListValue* args); | 57 void HandleIgnoreFailure(const base::ListValue* args); |
58 | 58 |
59 // Handle the 'extensionLoaderDisplayFailures' message. | 59 // Handle the 'extensionLoaderDisplayFailures' message. |
60 void HandleDisplayFailures(const base::ListValue* args); | 60 void HandleDisplayFailures(const base::ListValue* args); |
61 | 61 |
62 // Try to load an unpacked extension from the given |file_path|. | 62 // Try to load an unpacked extension from the given |file_path|. |
63 void LoadUnpackedExtensionImpl(const base::FilePath& file_path); | 63 void LoadUnpackedExtensionImpl(const base::FilePath& file_path); |
64 | 64 |
65 // ExtensionErrorReporter::Observer: | 65 // ExtensionErrorReporter::Observer: |
66 virtual void OnLoadFailure(content::BrowserContext* browser_context, | 66 virtual void OnLoadFailure(content::BrowserContext* browser_context, |
67 const base::FilePath& file_path, | 67 const base::FilePath& file_path, |
68 const std::string& error) OVERRIDE; | 68 const std::string& error) override; |
69 | 69 |
70 // content::WebContentsObserver: | 70 // content::WebContentsObserver: |
71 virtual void DidStartNavigationToPendingEntry( | 71 virtual void DidStartNavigationToPendingEntry( |
72 const GURL& url, | 72 const GURL& url, |
73 content::NavigationController::ReloadType reload_type) OVERRIDE; | 73 content::NavigationController::ReloadType reload_type) override; |
74 | 74 |
75 // Add a failure to |failures_|. If it was a manifest error, |manifest| will | 75 // Add a failure to |failures_|. If it was a manifest error, |manifest| will |
76 // hold the manifest contents, and |line_number| will point to the line at | 76 // hold the manifest contents, and |line_number| will point to the line at |
77 // which the error was found. | 77 // which the error was found. |
78 void AddFailure(const base::FilePath& file_path, | 78 void AddFailure(const base::FilePath& file_path, |
79 const std::string& error, | 79 const std::string& error, |
80 size_t line_number, | 80 size_t line_number, |
81 const std::string& manifest); | 81 const std::string& manifest); |
82 | 82 |
83 // Notify the frontend of all failures. | 83 // Notify the frontend of all failures. |
(...skipping 22 matching lines...) Expand all Loading... |
106 | 106 |
107 // Weak pointer factory for posting background tasks. | 107 // Weak pointer factory for posting background tasks. |
108 base::WeakPtrFactory<ExtensionLoaderHandler> weak_ptr_factory_; | 108 base::WeakPtrFactory<ExtensionLoaderHandler> weak_ptr_factory_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(ExtensionLoaderHandler); | 110 DISALLOW_COPY_AND_ASSIGN(ExtensionLoaderHandler); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace extensions | 113 } // namespace extensions |
114 | 114 |
115 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ | 115 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_LOADER_HANDLER_H_ |
OLD | NEW |