OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/renderer/extensions/dom_activity_logger.h" | 5 #include "chrome/renderer/extensions/dom_activity_logger.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/common/extensions/dom_action_types.h" | 8 #include "chrome/common/extensions/dom_action_types.h" |
9 #include "chrome/common/extensions/extension_messages.h" | 9 #include "chrome/common/extensions/extension_messages.h" |
10 #include "chrome/renderer/chrome_render_process_observer.h" | 10 #include "chrome/renderer/chrome_render_process_observer.h" |
11 #include "chrome/renderer/extensions/activity_log_converter_strategy.h" | 11 #include "chrome/renderer/extensions/activity_log_converter_strategy.h" |
12 #include "content/public/renderer/render_thread.h" | 12 #include "content/public/renderer/render_thread.h" |
13 #include "content/public/renderer/v8_value_converter.h" | 13 #include "content/public/renderer/v8_value_converter.h" |
14 #include "third_party/WebKit/public/platform/WebString.h" | 14 #include "third_party/WebKit/public/platform/WebString.h" |
15 #include "third_party/WebKit/public/platform/WebURL.h" | 15 #include "third_party/WebKit/public/platform/WebURL.h" |
16 #include "third_party/WebKit/public/web/WebDOMActivityLogger.h" | 16 #include "third_party/WebKit/public/web/WebDOMActivityLogger.h" |
17 #include "v8/include/v8.h" | 17 #include "v8/include/v8.h" |
18 | 18 |
19 using content::V8ValueConverter; | 19 using content::V8ValueConverter; |
20 using WebKit::WebString; | 20 using blink::WebString; |
21 using WebKit::WebURL; | 21 using blink::WebURL; |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 | 24 |
25 DOMActivityLogger::DOMActivityLogger(const std::string& extension_id) | 25 DOMActivityLogger::DOMActivityLogger(const std::string& extension_id) |
26 : extension_id_(extension_id) {} | 26 : extension_id_(extension_id) {} |
27 | 27 |
28 void DOMActivityLogger::log( | 28 void DOMActivityLogger::log( |
29 const WebString& api_name, | 29 const WebString& api_name, |
30 int argc, | 30 int argc, |
31 const v8::Handle<v8::Value> argv[], | 31 const v8::Handle<v8::Value> argv[], |
(...skipping 24 matching lines...) Expand all Loading... |
56 | 56 |
57 content::RenderThread::Get()->Send( | 57 content::RenderThread::Get()->Send( |
58 new ExtensionHostMsg_AddDOMActionToActivityLog(extension_id_, params)); | 58 new ExtensionHostMsg_AddDOMActionToActivityLog(extension_id_, params)); |
59 } | 59 } |
60 | 60 |
61 void DOMActivityLogger::AttachToWorld(int world_id, | 61 void DOMActivityLogger::AttachToWorld(int world_id, |
62 const std::string& extension_id) { | 62 const std::string& extension_id) { |
63 #if defined(ENABLE_EXTENSIONS) | 63 #if defined(ENABLE_EXTENSIONS) |
64 // If there is no logger registered for world_id, construct a new logger | 64 // If there is no logger registered for world_id, construct a new logger |
65 // and register it with world_id. | 65 // and register it with world_id. |
66 if (!WebKit::hasDOMActivityLogger(world_id)) { | 66 if (!blink::hasDOMActivityLogger(world_id)) { |
67 DOMActivityLogger* logger = new DOMActivityLogger(extension_id); | 67 DOMActivityLogger* logger = new DOMActivityLogger(extension_id); |
68 WebKit::setDOMActivityLogger(world_id, logger); | 68 blink::setDOMActivityLogger(world_id, logger); |
69 } | 69 } |
70 #endif | 70 #endif |
71 } | 71 } |
72 | 72 |
73 } // namespace extensions | 73 } // namespace extensions |
74 | 74 |
OLD | NEW |