| 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" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 const WebString& call_type, | 32 const WebString& call_type, |
| 33 const WebURL& url, | 33 const WebURL& url, |
| 34 const WebString& title) { | 34 const WebString& title) { |
| 35 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); | 35 scoped_ptr<V8ValueConverter> converter(V8ValueConverter::create()); |
| 36 ActivityLogConverterStrategy strategy; | 36 ActivityLogConverterStrategy strategy; |
| 37 converter->SetFunctionAllowed(true); | 37 converter->SetFunctionAllowed(true); |
| 38 converter->SetStrategy(&strategy); | 38 converter->SetStrategy(&strategy); |
| 39 scoped_ptr<ListValue> argv_list_value(new ListValue()); | 39 scoped_ptr<ListValue> argv_list_value(new ListValue()); |
| 40 for (int i =0; i < argc; i++) { | 40 for (int i =0; i < argc; i++) { |
| 41 argv_list_value->Set( | 41 argv_list_value->Set( |
| 42 i, converter->FromV8Value(argv[i], v8::Context::GetCurrent())); | 42 i, |
| 43 converter->FromV8Value(argv[i], |
| 44 v8::Isolate::GetCurrent()->GetCurrentContext())); |
| 43 } | 45 } |
| 44 ExtensionHostMsg_DOMAction_Params params; | 46 ExtensionHostMsg_DOMAction_Params params; |
| 45 params.url = url; | 47 params.url = url; |
| 46 params.url_title = title; | 48 params.url_title = title; |
| 47 params.api_call = api_name.utf8(); | 49 params.api_call = api_name.utf8(); |
| 48 params.arguments.Swap(argv_list_value.get()); | 50 params.arguments.Swap(argv_list_value.get()); |
| 49 const std::string type = call_type.utf8(); | 51 const std::string type = call_type.utf8(); |
| 50 if (type == "Getter") | 52 if (type == "Getter") |
| 51 params.call_type = DomActionType::GETTER; | 53 params.call_type = DomActionType::GETTER; |
| 52 else if (type == "Setter") | 54 else if (type == "Setter") |
| (...skipping 12 matching lines...) Expand all Loading... |
| 65 // and register it with world_id. | 67 // and register it with world_id. |
| 66 if (!blink::hasDOMActivityLogger(world_id)) { | 68 if (!blink::hasDOMActivityLogger(world_id)) { |
| 67 DOMActivityLogger* logger = new DOMActivityLogger(extension_id); | 69 DOMActivityLogger* logger = new DOMActivityLogger(extension_id); |
| 68 blink::setDOMActivityLogger(world_id, logger); | 70 blink::setDOMActivityLogger(world_id, logger); |
| 69 } | 71 } |
| 70 #endif | 72 #endif |
| 71 } | 73 } |
| 72 | 74 |
| 73 } // namespace extensions | 75 } // namespace extensions |
| 74 | 76 |
| OLD | NEW |