| 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 "base/keyboard_codes.h" | 7 #include "base/keyboard_codes.h" |
| 8 #include "chrome/browser/automation/ui_controls.h" | 8 #include "chrome/browser/automation/ui_controls.h" |
| 9 #include "chrome/browser/browser_window.h" | 9 #include "chrome/browser/browser_window.h" |
| 10 #include "chrome/browser/external_tab_container.h" | 10 #include "chrome/browser/external_tab_container.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 MoveMouse(end); | 211 MoveMouse(end); |
| 212 | 212 |
| 213 if (press_escape_en_route) { | 213 if (press_escape_en_route) { |
| 214 // Press Escape. | 214 // Press Escape. |
| 215 ui_controls::SendKeyPress(window, base::VKEY_ESCAPE, | 215 ui_controls::SendKeyPress(window, base::VKEY_ESCAPE, |
| 216 ((flags & views::Event::EF_CONTROL_DOWN) | 216 ((flags & views::Event::EF_CONTROL_DOWN) |
| 217 == views::Event::EF_CONTROL_DOWN), | 217 == views::Event::EF_CONTROL_DOWN), |
| 218 ((flags & views::Event::EF_SHIFT_DOWN) == | 218 ((flags & views::Event::EF_SHIFT_DOWN) == |
| 219 views::Event::EF_SHIFT_DOWN), | 219 views::Event::EF_SHIFT_DOWN), |
| 220 ((flags & views::Event::EF_ALT_DOWN) == | 220 ((flags & views::Event::EF_ALT_DOWN) == |
| 221 views::Event::EF_ALT_DOWN)); | 221 views::Event::EF_ALT_DOWN), |
| 222 false); |
| 222 } | 223 } |
| 223 SendMessage(top_level_hwnd, up_message, wparam_flags, | 224 SendMessage(top_level_hwnd, up_message, wparam_flags, |
| 224 MAKELPARAM(end.x, end.y)); | 225 MAKELPARAM(end.x, end.y)); |
| 225 | 226 |
| 226 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( | 227 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( |
| 227 new WindowDragResponseTask(this, reply_message))); | 228 new WindowDragResponseTask(this, reply_message))); |
| 228 } else { | 229 } else { |
| 229 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); | 230 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); |
| 230 Send(reply_message); | 231 Send(reply_message); |
| 231 } | 232 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 488 } |
| 488 } | 489 } |
| 489 | 490 |
| 490 void AutomationProvider::GetWindowTitle(int handle, string16* text) { | 491 void AutomationProvider::GetWindowTitle(int handle, string16* text) { |
| 491 gfx::NativeWindow window = window_tracker_->GetResource(handle); | 492 gfx::NativeWindow window = window_tracker_->GetResource(handle); |
| 492 std::wstring result; | 493 std::wstring result; |
| 493 int length = ::GetWindowTextLength(window) + 1; | 494 int length = ::GetWindowTextLength(window) + 1; |
| 494 ::GetWindowText(window, WriteInto(&result, length), length); | 495 ::GetWindowText(window, WriteInto(&result, length), length); |
| 495 text->assign(WideToUTF16(result)); | 496 text->assign(WideToUTF16(result)); |
| 496 } | 497 } |
| OLD | NEW |