| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 NOTREACHED(); | 356 NOTREACHED(); |
| 357 return; | 357 return; |
| 358 } | 358 } |
| 359 | 359 |
| 360 TabContents* tab_contents = tab->tab_contents(); | 360 TabContents* tab_contents = tab->tab_contents(); |
| 361 if (!tab_contents || !tab_contents->delegate()) { | 361 if (!tab_contents || !tab_contents->delegate()) { |
| 362 NOTREACHED(); | 362 NOTREACHED(); |
| 363 return; | 363 return; |
| 364 } | 364 } |
| 365 | 365 |
| 366 tab_contents->delegate()->ExecuteContextMenuCommand(command); | 366 tab_contents->delegate()->ExecuteContextMenuCommand(command, 0); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 void AutomationProvider::ConnectExternalTab( | 370 void AutomationProvider::ConnectExternalTab( |
| 371 uint64 cookie, | 371 uint64 cookie, |
| 372 bool allow, | 372 bool allow, |
| 373 gfx::NativeWindow parent_window, | 373 gfx::NativeWindow parent_window, |
| 374 gfx::NativeWindow* tab_container_window, | 374 gfx::NativeWindow* tab_container_window, |
| 375 gfx::NativeWindow* tab_window, | 375 gfx::NativeWindow* tab_window, |
| 376 int* tab_handle, | 376 int* tab_handle, |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 463 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 464 if (tab_tracker_->ContainsHandle(handle)) { | 464 if (tab_tracker_->ContainsHandle(handle)) { |
| 465 NavigationController* tab = tab_tracker_->GetResource(handle); | 465 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 466 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 466 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
| 467 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 467 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
| 468 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); | 468 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); |
| 469 host->Send(new ViewMsg_Zoom(host->routing_id(), zoom)); | 469 host->Send(new ViewMsg_Zoom(host->routing_id(), zoom)); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 } | 472 } |
| OLD | NEW |