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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 208793005: Remove JavaScript execution from RenderViewHost. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 months 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 1009
1010 void TestingAutomationProvider::ExecuteJavascriptInRenderViewFrame( 1010 void TestingAutomationProvider::ExecuteJavascriptInRenderViewFrame(
1011 const base::string16& frame_xpath, 1011 const base::string16& frame_xpath,
1012 const base::string16& script, 1012 const base::string16& script,
1013 IPC::Message* reply_message, 1013 IPC::Message* reply_message,
1014 RenderViewHost* render_view_host) { 1014 RenderViewHost* render_view_host) {
1015 // Set the routing id of this message with the controller. 1015 // Set the routing id of this message with the controller.
1016 // This routing id needs to be remembered for the reverse 1016 // This routing id needs to be remembered for the reverse
1017 // communication while sending back the response of 1017 // communication while sending back the response of
1018 // this javascript execution. 1018 // this javascript execution.
1019 render_view_host->ExecuteJavascriptInWebFrame( 1019
1020 frame_xpath, 1020 // Automation is dead. http://crbug.com/316203
1021 base::ASCIIToUTF16("window.domAutomationController.setAutomationId(0);")); 1021 NOTREACHED() << "Automation is dead.";
1022 render_view_host->ExecuteJavascriptInWebFrame(
1023 frame_xpath, script);
1024 } 1022 }
1025 1023
1026 void TestingAutomationProvider::ExecuteJavascript( 1024 void TestingAutomationProvider::ExecuteJavascript(
1027 int handle, 1025 int handle,
1028 const std::wstring& frame_xpath, 1026 const std::wstring& frame_xpath,
1029 const std::wstring& script, 1027 const std::wstring& script,
1030 IPC::Message* reply_message) { 1028 IPC::Message* reply_message) {
1031 WebContents* web_contents = GetWebContentsForHandle(handle, NULL); 1029 WebContents* web_contents = GetWebContentsForHandle(handle, NULL);
1032 if (!web_contents) { 1030 if (!web_contents) {
1033 AutomationMsg_DomOperation::WriteReplyParams(reply_message, std::string()); 1031 AutomationMsg_DomOperation::WriteReplyParams(reply_message, std::string());
(...skipping 4206 matching lines...) Expand 10 before | Expand all | Expand 10 after
5240 if (g_browser_process) 5238 if (g_browser_process)
5241 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5239 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5242 } 5240 }
5243 5241
5244 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5242 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5245 WebContents* tab) { 5243 WebContents* tab) {
5246 TabStripModel* tab_strip = browser->tab_strip_model(); 5244 TabStripModel* tab_strip = browser->tab_strip_model();
5247 if (tab_strip->GetActiveWebContents() != tab) 5245 if (tab_strip->GetActiveWebContents() != tab)
5248 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5246 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5249 } 5247 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698