| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 const std::string& target) { | 355 const std::string& target) { |
| 356 RenderViewHost* view_host = GetViewForTab(handle); | 356 RenderViewHost* view_host = GetViewForTab(handle); |
| 357 if (!view_host) | 357 if (!view_host) |
| 358 return; | 358 return; |
| 359 | 359 |
| 360 view_host->Send(new ChromeViewMsg_HandleMessageFromExternalHost( | 360 view_host->Send(new ChromeViewMsg_HandleMessageFromExternalHost( |
| 361 view_host->routing_id(), message, origin, target)); | 361 view_host->routing_id(), message, origin, target)); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void AutomationProvider::NavigateInExternalTab( | 364 void AutomationProvider::NavigateInExternalTab( |
| 365 int handle, const GURL& url, const GURL& referrer, | 365 int handle, const content::Referrer& url, const GURL& referrer, |
| 366 AutomationMsg_NavigationResponseValues* status) { | 366 AutomationMsg_NavigationResponseValues* status) { |
| 367 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 367 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
| 368 | 368 |
| 369 if (tab_tracker_->ContainsHandle(handle)) { | 369 if (tab_tracker_->ContainsHandle(handle)) { |
| 370 NavigationController* tab = tab_tracker_->GetResource(handle); | 370 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 371 tab->LoadURL(url, referrer, content::PAGE_TRANSITION_TYPED, std::string()); | 371 tab->LoadURL(url, referrer, content::PAGE_TRANSITION_TYPED, std::string()); |
| 372 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; | 372 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 396 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 396 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 397 if (tab_tracker_->ContainsHandle(handle)) { | 397 if (tab_tracker_->ContainsHandle(handle)) { |
| 398 NavigationController* tab = tab_tracker_->GetResource(handle); | 398 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 399 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 399 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
| 400 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 400 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
| 401 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); | 401 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); |
| 402 host->Zoom(zoom); | 402 host->Zoom(zoom); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 } | 405 } |
| OLD | NEW |