| 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 "chrome/browser/automation/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 void AutomationProvider::OnMessageFromExternalHost(int handle, | 355 void AutomationProvider::OnMessageFromExternalHost(int handle, |
| 356 const std::string& message, | 356 const std::string& message, |
| 357 const std::string& origin, | 357 const std::string& origin, |
| 358 const std::string& target) { | 358 const std::string& target) { |
| 359 RenderViewHost* view_host = GetViewForTab(handle); | 359 RenderViewHost* view_host = GetViewForTab(handle); |
| 360 if (!view_host) | 360 if (!view_host) |
| 361 return; | 361 return; |
| 362 | 362 |
| 363 view_host->Send(new ChromeViewMsg_HandleMessageFromExternalHost( | 363 view_host->Send(new ChromeViewMsg_HandleMessageFromExternalHost( |
| 364 view_host->routing_id(), message, origin, target)); | 364 view_host->GetRoutingID(), message, origin, target)); |
| 365 } | 365 } |
| 366 | 366 |
| 367 void AutomationProvider::NavigateInExternalTab( | 367 void AutomationProvider::NavigateInExternalTab( |
| 368 int handle, const GURL& url, const GURL& referrer, | 368 int handle, const GURL& url, const GURL& referrer, |
| 369 AutomationMsg_NavigationResponseValues* status) { | 369 AutomationMsg_NavigationResponseValues* status) { |
| 370 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 370 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
| 371 | 371 |
| 372 if (tab_tracker_->ContainsHandle(handle)) { | 372 if (tab_tracker_->ContainsHandle(handle)) { |
| 373 NavigationController* tab = tab_tracker_->GetResource(handle); | 373 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 374 tab->LoadURL( | 374 tab->LoadURL( |
| (...skipping 27 matching lines...) Expand all Loading... |
| 402 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 402 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 403 if (tab_tracker_->ContainsHandle(handle)) { | 403 if (tab_tracker_->ContainsHandle(handle)) { |
| 404 NavigationController* tab = tab_tracker_->GetResource(handle); | 404 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 405 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { | 405 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { |
| 406 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); | 406 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); |
| 407 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); | 407 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); |
| 408 host->Zoom(zoom); | 408 host->Zoom(zoom); |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 } | 411 } |
| OLD | NEW |