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/callback.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 ui::EF_CONTROL_DOWN), | 210 ui::EF_CONTROL_DOWN), |
211 ((flags & ui::EF_SHIFT_DOWN) == | 211 ((flags & ui::EF_SHIFT_DOWN) == |
212 ui::EF_SHIFT_DOWN), | 212 ui::EF_SHIFT_DOWN), |
213 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), | 213 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), |
214 false, | 214 false, |
215 MessageLoop::QuitClosure()); | 215 MessageLoop::QuitClosure()); |
216 MessageLoopForUI* loop = MessageLoopForUI::current(); | 216 MessageLoopForUI* loop = MessageLoopForUI::current(); |
217 bool did_allow_task_nesting = loop->NestableTasksAllowed(); | 217 bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
218 loop->SetNestableTasksAllowed(true); | 218 loop->SetNestableTasksAllowed(true); |
219 views::AcceleratorHandler handler; | 219 views::AcceleratorHandler handler; |
220 loop->Run(&handler); | 220 loop->RunWithDispatcher(&handler); |
221 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 221 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
222 } | 222 } |
223 SendMessage(top_level_hwnd, up_message, wparam_flags, | 223 SendMessage(top_level_hwnd, up_message, wparam_flags, |
224 MAKELPARAM(end.x, end.y)); | 224 MAKELPARAM(end.x, end.y)); |
225 | 225 |
226 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( | 226 MessageLoop::current()->PostTask(FROM_HERE, new InvokeTaskLaterTask( |
227 new WindowDragResponseTask(this, reply_message))); | 227 new WindowDragResponseTask(this, reply_message))); |
228 } else { | 228 } else { |
229 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); | 229 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); |
230 Send(reply_message); | 230 Send(reply_message); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { | 465 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { |
466 if (tab_tracker_->ContainsHandle(handle)) { | 466 if (tab_tracker_->ContainsHandle(handle)) { |
467 NavigationController* tab = tab_tracker_->GetResource(handle); | 467 NavigationController* tab = tab_tracker_->GetResource(handle); |
468 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { | 468 if (tab->tab_contents() && tab->tab_contents()->render_view_host()) { |
469 RenderViewHost* host = tab->tab_contents()->render_view_host(); | 469 RenderViewHost* host = tab->tab_contents()->render_view_host(); |
470 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); | 470 PageZoom::Function zoom = static_cast<PageZoom::Function>(zoom_level); |
471 host->Zoom(zoom); | 471 host->Zoom(zoom); |
472 } | 472 } |
473 } | 473 } |
474 } | 474 } |
OLD | NEW |