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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 GURL& 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( |
372 url, | |
373 content::Referrer(referrer, WebKit::WebReferrerPolicyDefault), | |
Avi (use Gerrit)
2011/12/05 02:33:48
Huh. I'm not sure I've seen WebKit types directly
| |
374 content::PAGE_TRANSITION_TYPED, std::string()); | |
372 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; | 375 *status = AUTOMATION_MSG_NAVIGATION_SUCCESS; |
373 } | 376 } |
374 } | 377 } |
375 | 378 |
376 void AutomationProvider::NavigateExternalTabAtIndex( | 379 void AutomationProvider::NavigateExternalTabAtIndex( |
377 int handle, int navigation_index, | 380 int handle, int navigation_index, |
378 AutomationMsg_NavigationResponseValues* status) { | 381 AutomationMsg_NavigationResponseValues* status) { |
379 *status = AUTOMATION_MSG_NAVIGATION_ERROR; | 382 *status = AUTOMATION_MSG_NAVIGATION_ERROR; |
380 | 383 |
381 if (tab_tracker_->ContainsHandle(handle)) { | 384 if (tab_tracker_->ContainsHandle(handle)) { |
(...skipping 14 matching lines...) Expand all Loading... | |
396 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 399 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
397 if (tab_tracker_->ContainsHandle(handle)) { | 400 if (tab_tracker_->ContainsHandle(handle)) { |
398 NavigationController* tab = tab_tracker_->GetResource(handle); | 401 NavigationController* tab = tab_tracker_->GetResource(handle); |
399 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 402 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
400 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 403 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
401 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); | 404 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); |
402 host->Zoom(zoom); | 405 host->Zoom(zoom); |
403 } | 406 } |
404 } | 407 } |
405 } | 408 } |
OLD | NEW |