| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/keyboard_codes.h" |
| 7 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 8 #include "base/keyboard_codes.h" | |
| 9 #include "base/trace_event.h" | 9 #include "base/trace_event.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/automation/automation_browser_tracker.h" | 11 #include "chrome/browser/automation/automation_browser_tracker.h" |
| 12 #include "chrome/browser/automation/automation_extension_function.h" | 12 #include "chrome/browser/automation/automation_extension_function.h" |
| 13 #include "chrome/browser/automation/automation_tab_tracker.h" | 13 #include "chrome/browser/automation/automation_tab_tracker.h" |
| 14 #include "chrome/browser/automation/automation_window_tracker.h" | 14 #include "chrome/browser/automation/automation_window_tracker.h" |
| 15 #include "chrome/browser/automation/extension_automation_constants.h" | 15 #include "chrome/browser/automation/extension_automation_constants.h" |
| 16 #include "chrome/browser/automation/extension_port_container.h" | 16 #include "chrome/browser/automation/extension_port_container.h" |
| 17 #include "chrome/browser/automation/ui_controls.h" | 17 #include "chrome/browser/automation/ui_controls.h" |
| 18 #include "chrome/browser/browser_window.h" | 18 #include "chrome/browser/browser_window.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 MoveMouse(temp); | 193 MoveMouse(temp); |
| 194 SendMessage(top_level_hwnd, WM_MOUSEMOVE, wparam_flags, | 194 SendMessage(top_level_hwnd, WM_MOUSEMOVE, wparam_flags, |
| 195 MAKELPARAM(drag_path[i].x(), drag_path[i].y())); | 195 MAKELPARAM(drag_path[i].x(), drag_path[i].y())); |
| 196 } | 196 } |
| 197 POINT end = drag_path[drag_path.size() - 1].ToPOINT(); | 197 POINT end = drag_path[drag_path.size() - 1].ToPOINT(); |
| 198 MapWindowPoints(top_level_hwnd, HWND_DESKTOP, &end, 1); | 198 MapWindowPoints(top_level_hwnd, HWND_DESKTOP, &end, 1); |
| 199 MoveMouse(end); | 199 MoveMouse(end); |
| 200 | 200 |
| 201 if (press_escape_en_route) { | 201 if (press_escape_en_route) { |
| 202 // Press Escape. | 202 // Press Escape. |
| 203 ui_controls::SendKeyPress(window, base::VKEY_ESCAPE, | 203 ui_controls::SendKeyPress(window, app::VKEY_ESCAPE, |
| 204 ((flags & views::Event::EF_CONTROL_DOWN) | 204 ((flags & views::Event::EF_CONTROL_DOWN) |
| 205 == views::Event::EF_CONTROL_DOWN), | 205 == views::Event::EF_CONTROL_DOWN), |
| 206 ((flags & views::Event::EF_SHIFT_DOWN) == | 206 ((flags & views::Event::EF_SHIFT_DOWN) == |
| 207 views::Event::EF_SHIFT_DOWN), | 207 views::Event::EF_SHIFT_DOWN), |
| 208 ((flags & views::Event::EF_ALT_DOWN) == | 208 ((flags & views::Event::EF_ALT_DOWN) == |
| 209 views::Event::EF_ALT_DOWN), | 209 views::Event::EF_ALT_DOWN), |
| 210 false); | 210 false); |
| 211 } | 211 } |
| 212 SendMessage(top_level_hwnd, up_message, wparam_flags, | 212 SendMessage(top_level_hwnd, up_message, wparam_flags, |
| 213 MAKELPARAM(end.x, end.y)); | 213 MAKELPARAM(end.x, end.y)); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 529 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
| 530 if (tab_tracker_->ContainsHandle(handle)) { | 530 if (tab_tracker_->ContainsHandle(handle)) { |
| 531 NavigationController* tab = tab_tracker_->GetResource(handle); | 531 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 532 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 532 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
| 533 tab->tab_contents()->render_view_host()->Zoom( | 533 tab->tab_contents()->render_view_host()->Zoom( |
| 534 static_cast<PageZoom::Function>(zoom_level)); | 534 static_cast<PageZoom::Function>(zoom_level)); |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 } | 537 } |
| OLD | NEW |