Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/automation/automation_provider_win.cc

Issue 9384024: Prefer ScopedNestableTaskAllower over manual save/restore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 ui_controls::SendKeyPressNotifyWhenDone( 142 ui_controls::SendKeyPressNotifyWhenDone(
143 window, ui::VKEY_ESCAPE, 143 window, ui::VKEY_ESCAPE,
144 ((flags & ui::EF_CONTROL_DOWN) == 144 ((flags & ui::EF_CONTROL_DOWN) ==
145 ui::EF_CONTROL_DOWN), 145 ui::EF_CONTROL_DOWN),
146 ((flags & ui::EF_SHIFT_DOWN) == 146 ((flags & ui::EF_SHIFT_DOWN) ==
147 ui::EF_SHIFT_DOWN), 147 ui::EF_SHIFT_DOWN),
148 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN), 148 ((flags & ui::EF_ALT_DOWN) == ui::EF_ALT_DOWN),
149 false, 149 false,
150 MessageLoop::QuitClosure()); 150 MessageLoop::QuitClosure());
151 MessageLoopForUI* loop = MessageLoopForUI::current(); 151 MessageLoopForUI* loop = MessageLoopForUI::current();
152 bool did_allow_task_nesting = loop->NestableTasksAllowed(); 152 MessageLoop::ScopedNestableTaskAllower allow(loop);
153 loop->SetNestableTasksAllowed(true);
154 views::AcceleratorHandler handler; 153 views::AcceleratorHandler handler;
jar (doing other things) 2012/02/11 03:24:38 nit: although this mimics the existing code... IMO
dhollowa 2012/02/13 17:44:26 Done.
155 loop->RunWithDispatcher(&handler); 154 loop->RunWithDispatcher(&handler);
156 loop->SetNestableTasksAllowed(did_allow_task_nesting);
157 } 155 }
158 SendMessage(top_level_hwnd, up_message, wparam_flags, 156 SendMessage(top_level_hwnd, up_message, wparam_flags,
159 MAKELPARAM(end.x, end.y)); 157 MAKELPARAM(end.x, end.y));
160 158
161 MessageLoop::current()->PostTask( 159 MessageLoop::current()->PostTask(
162 FROM_HERE, base::Bind( 160 FROM_HERE, base::Bind(
163 &InvokeCallbackLater, 161 &InvokeCallbackLater,
164 base::Bind(&WindowDragResponseCallback, this, reply_message))); 162 base::Bind(&WindowDragResponseCallback, this, reply_message)));
165 } else { 163 } else {
166 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false); 164 AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) { 402 void AutomationProvider::OnSetZoomLevel(int handle, int zoom_level) {
405 if (tab_tracker_->ContainsHandle(handle)) { 403 if (tab_tracker_->ContainsHandle(handle)) {
406 NavigationController* tab = tab_tracker_->GetResource(handle); 404 NavigationController* tab = tab_tracker_->GetResource(handle);
407 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) { 405 if (tab->GetWebContents() && tab->GetWebContents()->GetRenderViewHost()) {
408 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost(); 406 RenderViewHost* host = tab->GetWebContents()->GetRenderViewHost();
409 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level); 407 content::PageZoom zoom = static_cast<content::PageZoom>(zoom_level);
410 host->Zoom(zoom); 408 host->Zoom(zoom);
411 } 409 }
412 } 410 }
413 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698