OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ERROR_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ERROR_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ERROR_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ERROR_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/weak_ptr.h" |
12 #include "content/public/browser/web_ui_message_handler.h" | 13 #include "content/public/browser/web_ui_message_handler.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class DictionaryValue; | 16 class DictionaryValue; |
16 class ListValue; | 17 class ListValue; |
17 } | 18 } |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class WebUIDataSource; | 21 class WebUIDataSource; |
21 } | 22 } |
(...skipping 14 matching lines...) Expand all Loading... |
36 void GetLocalizedValues(content::WebUIDataSource* source); | 37 void GetLocalizedValues(content::WebUIDataSource* source); |
37 | 38 |
38 // WebUIMessageHandler implementation. | 39 // WebUIMessageHandler implementation. |
39 virtual void RegisterMessages() OVERRIDE; | 40 virtual void RegisterMessages() OVERRIDE; |
40 | 41 |
41 private: | 42 private: |
42 friend class ManifestHighlightUnitTest; | 43 friend class ManifestHighlightUnitTest; |
43 | 44 |
44 // Handle the "requestFileSource" call. | 45 // Handle the "requestFileSource" call. |
45 void HandleRequestFileSource(const base::ListValue* args); | 46 void HandleRequestFileSource(const base::ListValue* args); |
| 47 |
| 48 // Called when |error_ui_util::HandleRequestFileSource| finishes. |
| 49 void OnFileSourceHandled(const base::DictionaryValue& source); |
| 50 |
46 // Handle the "openDevTools" call. | 51 // Handle the "openDevTools" call. |
47 void HandleOpenDevTools(const base::ListValue* args); | 52 void HandleOpenDevTools(const base::ListValue* args); |
48 | 53 |
49 // Populate the results for a manifest file's content in response to the | 54 // Populate the results for a manifest file's content in response to the |
50 // "requestFileSource" call. Highlight the part of the manifest which | 55 // "requestFileSource" call. Highlight the part of the manifest which |
51 // corresponds to the given |key| and |specific| locations. Caller owns | 56 // corresponds to the given |key| and |specific| locations. Caller owns |
52 // |dict|. | 57 // |dict|. |
53 void GetManifestFileCallback(base::DictionaryValue* dict, | 58 void GetManifestFileCallback(base::DictionaryValue* dict, |
54 const std::string& key, | 59 const std::string& key, |
55 const std::string& specific, | 60 const std::string& specific, |
56 const std::string& contents); | 61 const std::string& contents); |
57 | 62 |
58 // Populate the results for a source file's content in response to the | 63 // Populate the results for a source file's content in response to the |
59 // "requestFileSource" call. Highlight the part of the source which | 64 // "requestFileSource" call. Highlight the part of the source which |
60 // corresponds to the given |line_number|. | 65 // corresponds to the given |line_number|. |
61 void GetSourceFileCallback(base::DictionaryValue* results, | 66 void GetSourceFileCallback(base::DictionaryValue* results, |
62 int line_number, | 67 int line_number, |
63 const std::string& contents); | 68 const std::string& contents); |
64 | 69 |
65 // The profile with which this Handler is associated. | 70 // The profile with which this Handler is associated. |
66 Profile* profile_; | 71 Profile* profile_; |
67 | 72 |
| 73 // Weak pointer factory for posting background tasks. |
| 74 base::WeakPtrFactory<ExtensionErrorHandler> weak_ptr_factory_; |
| 75 |
68 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorHandler); | 76 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorHandler); |
69 }; | 77 }; |
70 | 78 |
71 } // namespace extensions | 79 } // namespace extensions |
72 | 80 |
73 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ERROR_HANDLER_H_ | 81 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ERROR_HANDLER_H_ |
OLD | NEW |