OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_v8_extension.h" | 5 #include "chrome/renderer/extensions/chrome_v8_extension.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 #include "base/strings/string_util.h" | |
10 #include "base/strings/stringprintf.h" | |
11 #include "chrome/common/extensions/extension_set.h" | |
12 #include "chrome/renderer/extensions/chrome_v8_context.h" | 8 #include "chrome/renderer/extensions/chrome_v8_context.h" |
13 #include "chrome/renderer/extensions/dispatcher.h" | 9 #include "chrome/renderer/extensions/dispatcher.h" |
14 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
15 #include "extensions/common/extension.h" | |
16 #include "extensions/common/extension_api.h" | |
17 #include "third_party/WebKit/public/web/WebDocument.h" | |
18 #include "third_party/WebKit/public/web/WebFrame.h" | |
19 #include "third_party/WebKit/public/web/WebView.h" | |
20 #include "ui/base/resource/resource_bundle.h" | |
21 | |
22 using blink::WebDocument; | |
23 using blink::WebFrame; | |
24 using blink::WebView; | |
25 | 11 |
26 namespace extensions { | 12 namespace extensions { |
27 | 13 |
28 ChromeV8Extension::ChromeV8Extension(Dispatcher* dispatcher, | 14 ChromeV8Extension::ChromeV8Extension(Dispatcher* dispatcher, |
29 ChromeV8Context* context) | 15 ChromeV8Context* context) |
30 : ObjectBackedNativeHandler(context), | 16 : ObjectBackedNativeHandler(context), |
31 dispatcher_(dispatcher) { | 17 dispatcher_(dispatcher) { |
32 CHECK(dispatcher); | 18 CHECK(dispatcher); |
33 } | 19 } |
34 | 20 |
35 ChromeV8Extension::~ChromeV8Extension() { | 21 ChromeV8Extension::~ChromeV8Extension() { |
36 } | 22 } |
37 | 23 |
38 content::RenderView* ChromeV8Extension::GetRenderView() { | 24 content::RenderView* ChromeV8Extension::GetRenderView() { |
39 return context() ? context()->GetRenderView() : NULL; | 25 return context() ? context()->GetRenderView() : NULL; |
40 } | 26 } |
41 | 27 |
42 const Extension* ChromeV8Extension::GetExtensionForRenderView() { | 28 const Extension* ChromeV8Extension::GetExtensionForRenderView() { |
43 return context() ? context()->extension() : NULL; | 29 return context() ? context()->extension() : NULL; |
44 } | 30 } |
45 | 31 |
46 } // namespace extensions | 32 } // namespace extensions |
OLD | NEW |