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 #ifndef CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Marshalls the arguments into an ExtensionHostMsg_DOMAction_Params | 29 // Marshalls the arguments into an ExtensionHostMsg_DOMAction_Params |
30 // and sends it over to the browser (via IPC) for appending it to the | 30 // and sends it over to the browser (via IPC) for appending it to the |
31 // extension activity log. | 31 // extension activity log. |
32 // (Overrides the log method in WebKit::WebDOMActivityLogger) | 32 // (Overrides the log method in WebKit::WebDOMActivityLogger) |
33 virtual void log(const WebString& api_name, | 33 virtual void log(const WebString& api_name, |
34 int argc, | 34 int argc, |
35 const v8::Handle<v8::Value> argv[], | 35 const v8::Handle<v8::Value> argv[], |
36 const WebString& call_type); | 36 const WebString& call_type); |
37 | 37 |
38 // If extension activity logging is enabled then check (using the | 38 // Check (using the WebKit API) if there is no logger attached to the world |
39 // WebKit API) if there is no logger attached to the world corresponding | 39 // corresponding to world_id, and if so, construct a new logger and attach it. |
40 // to world_id, and if so, construct a new logger and attach it. | |
41 // worl_id = 0 indicates the main world. | 40 // worl_id = 0 indicates the main world. |
42 static void AttachToWorld(int world_id, | 41 static void AttachToWorld(int world_id, |
43 const std::string& extension_id, | 42 const std::string& extension_id, |
44 const GURL& url, | 43 const GURL& url, |
45 const string16& title); | 44 const string16& title); |
46 | 45 |
47 private: | 46 private: |
48 std::string extension_id_; | 47 std::string extension_id_; |
49 GURL url_; | 48 GURL url_; |
50 string16 title_; | 49 string16 title_; |
51 | 50 |
52 DISALLOW_COPY_AND_ASSIGN(DOMActivityLogger); | 51 DISALLOW_COPY_AND_ASSIGN(DOMActivityLogger); |
53 }; | 52 }; |
54 | 53 |
55 } // namespace extensions | 54 } // namespace extensions |
56 | 55 |
57 #endif // CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ | 56 #endif // CHROME_RENDERER_EXTENSIONS_DOM_ACTIVITY_LOGGER_H_ |
58 | 57 |
OLD | NEW |