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 "extensions/renderer/app_window_custom_bindings.h" | 5 #include "extensions/renderer/app_window_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "v8/include/v8.h" | 25 #include "v8/include/v8.h" |
26 | 26 |
27 namespace extensions { | 27 namespace extensions { |
28 | 28 |
29 class DidCreateDocumentElementObserver : public content::RenderViewObserver { | 29 class DidCreateDocumentElementObserver : public content::RenderViewObserver { |
30 public: | 30 public: |
31 DidCreateDocumentElementObserver(content::RenderView* view, | 31 DidCreateDocumentElementObserver(content::RenderView* view, |
32 Dispatcher* dispatcher) | 32 Dispatcher* dispatcher) |
33 : content::RenderViewObserver(view), dispatcher_(dispatcher) {} | 33 : content::RenderViewObserver(view), dispatcher_(dispatcher) {} |
34 | 34 |
35 virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) OVERRIDE { | 35 virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) override { |
36 DCHECK(frame); | 36 DCHECK(frame); |
37 DCHECK(dispatcher_); | 37 DCHECK(dispatcher_); |
38 // Don't attempt to inject the titlebar into iframes. | 38 // Don't attempt to inject the titlebar into iframes. |
39 if (frame->parent()) | 39 if (frame->parent()) |
40 return; | 40 return; |
41 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); | 41 v8::HandleScope handle_scope(v8::Isolate::GetCurrent()); |
42 ScriptContext* script_context = | 42 ScriptContext* script_context = |
43 dispatcher_->script_context_set().GetByV8Context( | 43 dispatcher_->script_context_set().GetByV8Context( |
44 frame->mainWorldScriptContext()); | 44 frame->mainWorldScriptContext()); |
45 | 45 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) | 122 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) |
123 .as_string()); | 123 .as_string()); |
124 scoped_ptr<content::V8ValueConverter> converter( | 124 scoped_ptr<content::V8ValueConverter> converter( |
125 content::V8ValueConverter::create()); | 125 content::V8ValueConverter::create()); |
126 result = converter->ToV8Value(&value, context()->v8_context()); | 126 result = converter->ToV8Value(&value, context()->v8_context()); |
127 } | 127 } |
128 args.GetReturnValue().Set(result); | 128 args.GetReturnValue().Set(result); |
129 } | 129 } |
130 | 130 |
131 } // namespace extensions | 131 } // namespace extensions |
OLD | NEW |