| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_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/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/debugger/devtools_client_host.h" | 17 #include "chrome/browser/debugger/devtools_client_host.h" |
| 18 #include "chrome/browser/debugger/devtools_manager.h" | 18 #include "chrome/browser/debugger/devtools_manager.h" |
| 19 #include "chrome/browser/extensions/extension_debugger_api_constants.h" | 19 #include "chrome/browser/extensions/extension_debugger_api_constants.h" |
| 20 #include "chrome/browser/extensions/extension_event_router.h" | 20 #include "chrome/browser/extensions/extension_event_router.h" |
| 21 #include "chrome/browser/extensions/extension_tabs_module.h" | 21 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 23 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 24 #include "chrome/common/devtools_messages.h" | |
| 25 #include "chrome/common/extensions/extension.h" | 24 #include "chrome/common/extensions/extension.h" |
| 26 #include "chrome/common/extensions/extension_error_utils.h" | 25 #include "chrome/common/extensions/extension_error_utils.h" |
| 27 #include "content/browser/tab_contents/tab_contents.h" | 26 #include "content/browser/tab_contents/tab_contents.h" |
| 27 #include "content/common/devtools_messages.h" |
| 28 #include "content/common/notification_service.h" | 28 #include "content/common/notification_service.h" |
| 29 | 29 |
| 30 namespace keys = extension_debugger_api_constants; | 30 namespace keys = extension_debugger_api_constants; |
| 31 | 31 |
| 32 class ExtensionDevToolsClientHost : public DevToolsClientHost, | 32 class ExtensionDevToolsClientHost : public DevToolsClientHost, |
| 33 public NotificationObserver { | 33 public NotificationObserver { |
| 34 public: | 34 public: |
| 35 ExtensionDevToolsClientHost(TabContents* tab_contents, | 35 ExtensionDevToolsClientHost(TabContents* tab_contents, |
| 36 const std::string& extension_id, | 36 const std::string& extension_id, |
| 37 int tab_id); | 37 int tab_id); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return; | 352 return; |
| 353 } | 353 } |
| 354 | 354 |
| 355 Value* result_body; | 355 Value* result_body; |
| 356 if (dictionary->Get("result", &result_body)) | 356 if (dictionary->Get("result", &result_body)) |
| 357 result_.reset(result_body->DeepCopy()); | 357 result_.reset(result_body->DeepCopy()); |
| 358 else | 358 else |
| 359 result_.reset(new DictionaryValue()); | 359 result_.reset(new DictionaryValue()); |
| 360 SendResponse(true); | 360 SendResponse(true); |
| 361 } | 361 } |
| OLD | NEW |