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 // Implements the Chrome Extensions Debugger API. | 5 // Implements the Chrome Extensions Debugger API. |
6 | 6 |
7 #include "chrome/browser/extensions/extension_debugger_api.h" | 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 | 11 |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/browser/extensions/extension_debugger_api_constants.h" | 18 #include "chrome/browser/extensions/api/debugger/debugger_api_constants.h" |
19 #include "chrome/browser/extensions/extension_event_router.h" | 19 #include "chrome/browser/extensions/extension_event_router.h" |
20 #include "chrome/browser/extensions/extension_tab_util.h" | 20 #include "chrome/browser/extensions/extension_tab_util.h" |
21 #include "chrome/browser/infobars/infobar.h" | 21 #include "chrome/browser/infobars/infobar.h" |
22 #include "chrome/browser/infobars/infobar_tab_helper.h" | 22 #include "chrome/browser/infobars/infobar_tab_helper.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 24 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
25 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 25 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
26 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 26 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
27 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
28 #include "chrome/common/extensions/extension.h" | 28 #include "chrome/common/extensions/extension.h" |
29 #include "chrome/common/extensions/extension_error_utils.h" | 29 #include "chrome/common/extensions/extension_error_utils.h" |
30 #include "content/public/browser/devtools_agent_host_registry.h" | 30 #include "content/public/browser/devtools_agent_host_registry.h" |
31 #include "content/public/browser/devtools_client_host.h" | 31 #include "content/public/browser/devtools_client_host.h" |
32 #include "content/public/browser/devtools_manager.h" | 32 #include "content/public/browser/devtools_manager.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
35 #include "content/public/browser/render_view_host.h" | 35 #include "content/public/browser/render_view_host.h" |
36 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
37 #include "content/public/common/content_client.h" | 37 #include "content/public/common/content_client.h" |
38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
39 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
40 #include "webkit/glue/webkit_glue.h" | 40 #include "webkit/glue/webkit_glue.h" |
41 | 41 |
42 using content::DevToolsAgentHost; | 42 using content::DevToolsAgentHost; |
43 using content::DevToolsAgentHostRegistry; | 43 using content::DevToolsAgentHostRegistry; |
44 using content::DevToolsClientHost; | 44 using content::DevToolsClientHost; |
45 using content::DevToolsManager; | 45 using content::DevToolsManager; |
46 using content::WebContents; | 46 using content::WebContents; |
47 | 47 |
48 namespace keys = extension_debugger_api_constants; | 48 namespace keys = debugger_api_constants; |
49 | |
50 | 49 |
51 class ExtensionDevToolsInfoBarDelegate : public ConfirmInfoBarDelegate { | 50 class ExtensionDevToolsInfoBarDelegate : public ConfirmInfoBarDelegate { |
52 public: | 51 public: |
53 ExtensionDevToolsInfoBarDelegate( | 52 ExtensionDevToolsInfoBarDelegate( |
54 InfoBarTabHelper* infobar_helper, | 53 InfoBarTabHelper* infobar_helper, |
55 const std::string& client_name); | 54 const std::string& client_name); |
56 virtual ~ExtensionDevToolsInfoBarDelegate(); | 55 virtual ~ExtensionDevToolsInfoBarDelegate(); |
57 | 56 |
58 private: | 57 private: |
59 // ConfirmInfoBarDelegate: | 58 // ConfirmInfoBarDelegate: |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 return; | 482 return; |
484 } | 483 } |
485 | 484 |
486 Value* result_body; | 485 Value* result_body; |
487 if (dictionary->Get("result", &result_body)) | 486 if (dictionary->Get("result", &result_body)) |
488 result_.reset(result_body->DeepCopy()); | 487 result_.reset(result_body->DeepCopy()); |
489 else | 488 else |
490 result_.reset(new DictionaryValue()); | 489 result_.reset(new DictionaryValue()); |
491 SendResponse(true); | 490 SendResponse(true); |
492 } | 491 } |
OLD | NEW |