| 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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/automation/automation_browser_tracker.h" | 10 #include "chrome/browser/automation/automation_browser_tracker.h" |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 view_host->routing_id(), message, origin, target)); | 429 view_host->routing_id(), message, origin, target)); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void AutomationProvider::NavigateInExternalTab( | 432 void AutomationProvider::NavigateInExternalTab( |
| 433 int handle, const GURL& url, const GURL& referrer, | 433 int handle, const GURL& url, const GURL& referrer, |
| 434 AutomationMsg_NavigationResponseValues* status) { | 434 AutomationMsg_NavigationResponseValues* status) { |
| 435 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 435 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
| 436 | 436 |
| 437 if (tab_tracker_->ContainsHandle(handle)) { | 437 if (tab_tracker_->ContainsHandle(handle)) { |
| 438 NavigationController* tab = tab_tracker_->GetResource(handle); | 438 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 439 tab->LoadURL(url, referrer, PageTransition::TYPED, std::string()); | 439 tab->LoadURL(url, referrer, content::PAGE_TRANSITION_TYPED, std::string()); |
| 440 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; | 440 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 void AutomationProvider::NavigateExternalTabAtIndex( | 444 void AutomationProvider::NavigateExternalTabAtIndex( |
| 445 int handle, int navigation_index, | 445 int handle, int navigation_index, |
| 446 AutomationMsg_NavigationResponseValues* status) { | 446 AutomationMsg_NavigationResponseValues* status) { |
| 447 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 447 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
| 448 | 448 |
| 449 if (tab_tracker_->ContainsHandle(handle)) { | 449 if (tab_tracker_->ContainsHandle(handle)) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 464 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 464 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 465 if (tab_tracker_->ContainsHandle(handle)) { | 465 if (tab_tracker_->ContainsHandle(handle)) { |
| 466 NavigationController* tab = tab_tracker_->GetResource(handle); | 466 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 467 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 467 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
| 468 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 468 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
| 469 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); | 469 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); |
| 470 host->Zoom(zoom); | 470 host->Zoom(zoom); |
| 471 } | 471 } |
| 472 } | 472 } |
| 473 } | 473 } |
| OLD | NEW |