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/extensions/extension_debugger_api_constants.h" | 17 #include "chrome/browser/extensions/extension_debugger_api_constants.h" |
18 #include "chrome/browser/extensions/extension_event_router.h" | 18 #include "chrome/browser/extensions/extension_event_router.h" |
19 #include "chrome/browser/extensions/extension_tab_util.h" | 19 #include "chrome/browser/extensions/extension_tab_util.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 21 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
22 #include "chrome/common/chrome_notification_types.h" | 22 #include "chrome/common/chrome_notification_types.h" |
23 #include "chrome/common/extensions/extension.h" | 23 #include "chrome/common/extensions/extension.h" |
24 #include "chrome/common/extensions/extension_error_utils.h" | 24 #include "chrome/common/extensions/extension_error_utils.h" |
25 #include "content/browser/debugger/devtools_client_host.h" | 25 #include "content/browser/debugger/devtools_client_host.h" |
26 #include "content/browser/debugger/devtools_manager.h" | 26 #include "content/browser/debugger/devtools_manager.h" |
27 #include "content/browser/tab_contents/tab_contents.h" | 27 #include "content/browser/tab_contents/tab_contents.h" |
28 #include "content/common/devtools_messages.h" | 28 #include "content/common/devtools_messages.h" |
29 #include "content/common/notification_service.h" | 29 #include "content/public/browser/notification_source.h" |
30 | 30 |
31 namespace keys = extension_debugger_api_constants; | 31 namespace keys = extension_debugger_api_constants; |
32 | 32 |
33 class ExtensionDevToolsClientHost : public DevToolsClientHost, | 33 class ExtensionDevToolsClientHost : public DevToolsClientHost, |
34 public content::NotificationObserver { | 34 public content::NotificationObserver { |
35 public: | 35 public: |
36 ExtensionDevToolsClientHost(TabContents* tab_contents, | 36 ExtensionDevToolsClientHost(TabContents* tab_contents, |
37 const std::string& extension_id, | 37 const std::string& extension_id, |
38 int tab_id); | 38 int tab_id); |
39 | 39 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return; | 358 return; |
359 } | 359 } |
360 | 360 |
361 Value* result_body; | 361 Value* result_body; |
362 if (dictionary->Get("result", &result_body)) | 362 if (dictionary->Get("result", &result_body)) |
363 result_.reset(result_body->DeepCopy()); | 363 result_.reset(result_body->DeepCopy()); |
364 else | 364 else |
365 result_.reset(new DictionaryValue()); | 365 result_.reset(new DictionaryValue()); |
366 SendResponse(true); | 366 SendResponse(true); |
367 } | 367 } |
OLD | NEW |