| 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 "content/shell/layout_test_controller_bindings.h" | 5 #include "content/shell/layout_test_controller_bindings.h" |
| 6 | 6 |
| 7 #include "base/string_piece.h" | 7 #include "base/string_piece.h" |
| 8 #include "content/public/renderer/render_view.h" | 8 #include "content/public/renderer/render_view.h" |
| 9 #include "content/shell/shell_messages.h" | 9 #include "content/shell/shell_messages.h" |
| 10 #include "grit/shell_resources.h" | 10 #include "grit/shell_resources.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 13 #include "ui/base/layout.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 14 | 15 |
| 15 using WebKit::WebFrame; | 16 using WebKit::WebFrame; |
| 16 using WebKit::WebView; | 17 using WebKit::WebView; |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 base::StringPiece GetStringResource(int resource_id) { | 23 base::StringPiece GetStringResource(int resource_id) { |
| 23 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); | 24 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 25 resource_id, ui::SCALE_FACTOR_NONE); |
| 24 } | 26 } |
| 25 | 27 |
| 26 RenderView* GetCurrentRenderView() { | 28 RenderView* GetCurrentRenderView() { |
| 27 WebFrame* frame = WebFrame::frameForCurrentContext(); | 29 WebFrame* frame = WebFrame::frameForCurrentContext(); |
| 28 DCHECK(frame); | 30 DCHECK(frame); |
| 29 if (!frame) | 31 if (!frame) |
| 30 return NULL; | 32 return NULL; |
| 31 | 33 |
| 32 WebView* view = frame->view(); | 34 WebView* view = frame->view(); |
| 33 if (!view) | 35 if (!view) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) | 100 if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) |
| 99 return v8::FunctionTemplate::New(SetDumpChildFramesAsText); | 101 return v8::FunctionTemplate::New(SetDumpChildFramesAsText); |
| 100 if (name->Equals(v8::String::New("SetWaitUntilDone"))) | 102 if (name->Equals(v8::String::New("SetWaitUntilDone"))) |
| 101 return v8::FunctionTemplate::New(SetWaitUntilDone); | 103 return v8::FunctionTemplate::New(SetWaitUntilDone); |
| 102 | 104 |
| 103 NOTREACHED(); | 105 NOTREACHED(); |
| 104 return v8::FunctionTemplate::New(); | 106 return v8::FunctionTemplate::New(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 } // namespace content | 109 } // namespace content |
| OLD | NEW |