| 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/callback.h" |
| 7 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 8 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/automation/automation_browser_tracker.h" | 11 #include "chrome/browser/automation/automation_browser_tracker.h" |
| 11 #include "chrome/browser/automation/automation_tab_tracker.h" | 12 #include "chrome/browser/automation/automation_tab_tracker.h" |
| 12 #include "chrome/browser/automation/automation_window_tracker.h" | 13 #include "chrome/browser/automation/automation_window_tracker.h" |
| 13 #include "chrome/browser/automation/ui_controls.h" | 14 #include "chrome/browser/automation/ui_controls.h" |
| 14 #include "chrome/browser/external_tab_container_win.h" | 15 #include "chrome/browser/external_tab_container_win.h" |
| 15 #include "chrome/browser/printing/print_view_manager.h" | 16 #include "chrome/browser/printing/print_view_manager.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // Press Escape, making sure we wait until chrome processes the escape. | 205 // Press Escape, making sure we wait until chrome processes the escape. |
| 205 // TODO(phajdan.jr): make this use ui_test_utils::SendKeyPressSync. | 206 // TODO(phajdan.jr): make this use ui_test_utils::SendKeyPressSync. |
| 206 ui_controls::SendKeyPressNotifyWhenDone( | 207 ui_controls::SendKeyPressNotifyWhenDone( |
| 207 window, ui::VKEY_ESCAPE, | 208 window, ui::VKEY_ESCAPE, |
| 208 ((flags & ui::EF_CONTROL_DOWN) == | 209 ((flags & ui::EF_CONTROL_DOWN) == |
| 209 ui::EF_CONTROL_DOWN), | 210 ui::EF_CONTROL_DOWN), |
| 210 ((flags & ui::EF_SHIFT_DOWN) == | 211 ((flags & ui::EF_SHIFT_DOWN) == |
| 211 ui::EF_SHIFT_DOWN), | 212 ui::EF_SHIFT_DOWN), |
| 212 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), | 213 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), |
| 213 false, | 214 false, |
| 214 new MessageLoop::QuitTask()); | 215 MessageLoop::QuitClosure()); |
| 215 MessageLoopForUI* loop = MessageLoopForUI::current(); | 216 MessageLoopForUI* loop = MessageLoopForUI::current(); |
| 216 bool did_allow_task_nesting = loop->NestableTasksAllowed(); | 217 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
| 217 loop->SetNestableTasksAllowed(true); | 218 loop->SetNestableTasksAllowed(true); |
| 218 views::AcceleratorHandler handler; | 219 views::AcceleratorHandler handler; |
| 219 loop->Run(&handler); | 220 loop->Run(&handler); |
| 220 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 221 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
| 221 } | 222 } |
| 222 SendMessage(top_level_hwnd, up_message, wparam_flags, | 223 SendMessage(top_level_hwnd, up_message, wparam_flags, |
| 223 MAKELPARAM(end.x, end.y)); | 224 MAKELPARAM(end.x, end.y)); |
| 224 | 225 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 465 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 465 if (tab_tracker_->ContainsHandle(handle)) { | 466 if (tab_tracker_->ContainsHandle(handle)) { |
| 466 NavigationController* tab = tab_tracker_->GetResource(handle); | 467 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 467 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 468 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
| 468 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 469 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
| 469 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); | 470 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); |
| 470 host->Zoom(zoom); | 471 host->Zoom(zoom); |
| 471 } | 472 } |
| 472 } | 473 } |
| 473 } | 474 } |
| OLD | NEW |