Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: content/shell/webkit_test_runner_bindings.cc

Issue 11414260: Revert 170451 - [content shell] add support for testRunner.canOpenWindows and disallow opening wind… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/shell/webkit_test_runner.js ('k') | content/shell/webkit_test_runner_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/webkit_test_runner_bindings.h" 5 #include "content/shell/webkit_test_runner_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 "content/shell/webkit_test_runner.h" 10 #include "content/shell/webkit_test_runner.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 v8::Handle<v8::Value> NotifyDone(const v8::Arguments& args) { 56 v8::Handle<v8::Value> NotifyDone(const v8::Arguments& args) {
57 RenderView* view = GetCurrentRenderView(); 57 RenderView* view = GetCurrentRenderView();
58 if (!view) 58 if (!view)
59 return v8::Undefined(); 59 return v8::Undefined();
60 60
61 view->Send(new ShellViewHostMsg_NotifyDone(view->GetRoutingID())); 61 view->Send(new ShellViewHostMsg_NotifyDone(view->GetRoutingID()));
62 return v8::Undefined(); 62 return v8::Undefined();
63 } 63 }
64 64
65 v8::Handle<v8::Value> SetCanOpenWindows(const v8::Arguments& args) {
66 RenderView* view = GetCurrentRenderView();
67 if (!view)
68 return v8::Undefined();
69
70 view->Send(new ShellViewHostMsg_CanOpenWindows(view->GetRoutingID()));
71 return v8::Undefined();
72 }
73
74 v8::Handle<v8::Value> SetDumpAsText(const v8::Arguments& args) { 65 v8::Handle<v8::Value> SetDumpAsText(const v8::Arguments& args) {
75 RenderView* view = GetCurrentRenderView(); 66 RenderView* view = GetCurrentRenderView();
76 if (!view) 67 if (!view)
77 return v8::Undefined(); 68 return v8::Undefined();
78 69
79 view->Send(new ShellViewHostMsg_DumpAsText(view->GetRoutingID())); 70 view->Send(new ShellViewHostMsg_DumpAsText(view->GetRoutingID()));
80 return v8::Undefined(); 71 return v8::Undefined();
81 } 72 }
82 73
83 v8::Handle<v8::Value> SetDumpChildFramesAsText(const v8::Arguments& args) { 74 v8::Handle<v8::Value> SetDumpChildFramesAsText(const v8::Arguments& args) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 166
176 WebKitTestRunnerBindings::~WebKitTestRunnerBindings() { 167 WebKitTestRunnerBindings::~WebKitTestRunnerBindings() {
177 } 168 }
178 169
179 v8::Handle<v8::FunctionTemplate> 170 v8::Handle<v8::FunctionTemplate>
180 WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) { 171 WebKitTestRunnerBindings::GetNativeFunction(v8::Handle<v8::String> name) {
181 if (name->Equals(v8::String::New("Display"))) 172 if (name->Equals(v8::String::New("Display")))
182 return v8::FunctionTemplate::New(Display); 173 return v8::FunctionTemplate::New(Display);
183 if (name->Equals(v8::String::New("NotifyDone"))) 174 if (name->Equals(v8::String::New("NotifyDone")))
184 return v8::FunctionTemplate::New(NotifyDone); 175 return v8::FunctionTemplate::New(NotifyDone);
185 if (name->Equals(v8::String::New("SetCanOpenWindows")))
186 return v8::FunctionTemplate::New(SetCanOpenWindows);
187 if (name->Equals(v8::String::New("SetDumpAsText"))) 176 if (name->Equals(v8::String::New("SetDumpAsText")))
188 return v8::FunctionTemplate::New(SetDumpAsText); 177 return v8::FunctionTemplate::New(SetDumpAsText);
189 if (name->Equals(v8::String::New("SetDumpChildFramesAsText"))) 178 if (name->Equals(v8::String::New("SetDumpChildFramesAsText")))
190 return v8::FunctionTemplate::New(SetDumpChildFramesAsText); 179 return v8::FunctionTemplate::New(SetDumpChildFramesAsText);
191 if (name->Equals(v8::String::New("SetPrinting"))) 180 if (name->Equals(v8::String::New("SetPrinting")))
192 return v8::FunctionTemplate::New(SetPrinting); 181 return v8::FunctionTemplate::New(SetPrinting);
193 if (name->Equals(v8::String::New( 182 if (name->Equals(v8::String::New(
194 "SetShouldStayOnPageAfterHandlingBeforeUnload"))) { 183 "SetShouldStayOnPageAfterHandlingBeforeUnload"))) {
195 return v8::FunctionTemplate::New( 184 return v8::FunctionTemplate::New(
196 SetShouldStayOnPageAfterHandlingBeforeUnload); 185 SetShouldStayOnPageAfterHandlingBeforeUnload);
197 } 186 }
198 if (name->Equals(v8::String::New("SetWaitUntilDone"))) 187 if (name->Equals(v8::String::New("SetWaitUntilDone")))
199 return v8::FunctionTemplate::New(SetWaitUntilDone); 188 return v8::FunctionTemplate::New(SetWaitUntilDone);
200 if (name->Equals(v8::String::New("SetXSSAuditorEnabled"))) 189 if (name->Equals(v8::String::New("SetXSSAuditorEnabled")))
201 return v8::FunctionTemplate::New(SetXSSAuditorEnabled); 190 return v8::FunctionTemplate::New(SetXSSAuditorEnabled);
202 if (name->Equals(v8::String::New("GetWorkerThreadCount"))) 191 if (name->Equals(v8::String::New("GetWorkerThreadCount")))
203 return v8::FunctionTemplate::New(GetWorkerThreadCount); 192 return v8::FunctionTemplate::New(GetWorkerThreadCount);
204 if (name->Equals(v8::String::New("NotImplemented"))) 193 if (name->Equals(v8::String::New("NotImplemented")))
205 return v8::FunctionTemplate::New(NotImplemented); 194 return v8::FunctionTemplate::New(NotImplemented);
206 195
207 NOTREACHED(); 196 NOTREACHED();
208 return v8::FunctionTemplate::New(); 197 return v8::FunctionTemplate::New();
209 } 198 }
210 199
211 } // namespace content 200 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/webkit_test_runner.js ('k') | content/shell/webkit_test_runner_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698