| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
| 9 #include "chrome/browser/automation/automation_provider_list.h" | 9 #include "chrome/browser/automation/automation_provider_list.h" |
| 10 #include "chrome/browser/automation/ui_controls.h" | 10 #include "chrome/browser/automation/ui_controls.h" |
| (...skipping 1574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 // Set the routing id of this message with the controller. | 1585 // Set the routing id of this message with the controller. |
| 1586 // This routing id needs to be remembered for the reverse | 1586 // This routing id needs to be remembered for the reverse |
| 1587 // communication while sending back the response of | 1587 // communication while sending back the response of |
| 1588 // this javascript execution. | 1588 // this javascript execution. |
| 1589 std::wstring url; | 1589 std::wstring url; |
| 1590 SStringPrintf(&url, | 1590 SStringPrintf(&url, |
| 1591 L"javascript:void(window.domAutomationController.setAutomationId(%d));", | 1591 L"javascript:void(window.domAutomationController.setAutomationId(%d));", |
| 1592 message.routing_id()); | 1592 message.routing_id()); |
| 1593 | 1593 |
| 1594 web_contents->render_view_host()->ExecuteJavascriptInWebFrame( | 1594 web_contents->render_view_host()->ExecuteJavascriptInWebFrame( |
| 1595 frame_xpath, url); | 1595 frame_xpath, url, L""); |
| 1596 web_contents->render_view_host()->ExecuteJavascriptInWebFrame( | 1596 web_contents->render_view_host()->ExecuteJavascriptInWebFrame( |
| 1597 frame_xpath, script); | 1597 frame_xpath, script, L""); |
| 1598 succeeded = true; | 1598 succeeded = true; |
| 1599 } | 1599 } |
| 1600 | 1600 |
| 1601 if (!succeeded) { | 1601 if (!succeeded) { |
| 1602 Send(new AutomationMsg_DomOperationResponse(message.routing_id(), "")); | 1602 Send(new AutomationMsg_DomOperationResponse(message.routing_id(), "")); |
| 1603 } | 1603 } |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 void AutomationProvider::GetShelfVisibility(const IPC::Message& message, | 1606 void AutomationProvider::GetShelfVisibility(const IPC::Message& message, |
| 1607 int handle) { | 1607 int handle) { |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2398 int value) { | 2398 int value) { |
| 2399 bool success = false; | 2399 bool success = false; |
| 2400 if (browser_tracker_->ContainsHandle(handle)) { | 2400 if (browser_tracker_->ContainsHandle(handle)) { |
| 2401 Browser* browser = browser_tracker_->GetResource(handle); | 2401 Browser* browser = browser_tracker_->GetResource(handle); |
| 2402 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value); | 2402 browser->profile()->GetPrefs()->SetInteger(name.c_str(), value); |
| 2403 success = true; | 2403 success = true; |
| 2404 } | 2404 } |
| 2405 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(), | 2405 Send(new AutomationMsg_SetIntPreferenceResponse(message.routing_id(), |
| 2406 success)); | 2406 success)); |
| 2407 } | 2407 } |
| OLD | NEW |