diff options
22 files changed, 38 insertions, 38 deletions
diff --git a/base/message_loop.cc b/base/message_loop.cc index 45bad48..4cdcb24 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -833,7 +833,7 @@ void MessageLoopForUI::RemoveObserver(Observer* observer) { pump_ui()->RemoveObserver(observer); } -void MessageLoopForUI::Run(Dispatcher* dispatcher) { +void MessageLoopForUI::RunWithDispatcher(Dispatcher* dispatcher) { AutoRunState save_state(this); state_->dispatcher = dispatcher; RunHandler(); diff --git a/base/message_loop.h b/base/message_loop.h index adb58e3..732de03 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -623,7 +623,7 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop { // methods. void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); - void Run(Dispatcher* dispatcher); + void RunWithDispatcher(Dispatcher* dispatcher); void RunAllPendingWithDispatcher(Dispatcher* dispatcher); protected: diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 092f58a..7eb4f4a 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -1120,7 +1120,7 @@ void RunTest_Dispatcher(MessageLoop::Type message_loop_type) { MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&MouseDownUp), 100); DispatcherImpl dispatcher; - MessageLoopForUI::current()->Run(&dispatcher); + MessageLoopForUI::current()->RunWithDispatcher(&dispatcher); ASSERT_EQ(2, dispatcher.dispatch_count_); } @@ -1143,7 +1143,7 @@ void RunTest_DispatcherWithMessageHook(MessageLoop::Type message_loop_type) { NULL, GetCurrentThreadId()); DispatcherImpl dispatcher; - MessageLoopForUI::current()->Run(&dispatcher); + MessageLoopForUI::current()->RunWithDispatcher(&dispatcher); ASSERT_EQ(1, dispatcher.dispatch_count_); UnhookWindowsHookEx(msg_hook); } diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index e5e98ff..1308b6a 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -167,7 +167,7 @@ void SearchProviderTest::RunTillProviderDone() { #if defined(OS_MACOSX) message_loop_.Run(); #else - message_loop_.Run(NULL); + message_loop_.RunWithDispatcher(NULL); #endif } diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index 95e28ea..fe905ea 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -217,7 +217,7 @@ void AutomationProvider::WindowSimulateDrag( bool did_allow_task_nesting = loop->NestableTasksAllowed(); loop->SetNestableTasksAllowed(true); views::AcceleratorHandler handler; - loop->Run(&handler); + loop->RunWithDispatcher(&handler); loop->SetNestableTasksAllowed(did_allow_task_nesting); } SendMessage(top_level_hwnd, up_message, wparam_flags, diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index ad4e0ca..46c9926 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1951,9 +1951,9 @@ void ChromeBrowserMainParts::MainMessageLoopRun() { aura::Desktop::GetInstance()->Run(); #elif defined(TOOLKIT_VIEWS) views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); #elif defined(USE_X11) - MessageLoopForUI::current()->Run(NULL); + MessageLoopForUI::current()->RunWithDispatcher(NULL); #elif defined(OS_POSIX) MessageLoopForUI::current()->Run(); #endif diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 711193c..f723969 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -97,7 +97,7 @@ int AskForUninstallConfirmation() { int ret = content::RESULT_CODE_NORMAL_EXIT; views::Widget::CreateWindow(new UninstallView(&ret))->Show(); views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); return ret; } diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc index 1e86752..84af86f 100644 --- a/chrome/browser/ui/views/first_run_search_engine_view.cc +++ b/chrome/browser/ui/views/first_run_search_engine_view.cc @@ -70,7 +70,7 @@ void ShowFirstRunDialog(Profile* profile, window->SetAlwaysOnTop(true); window->Show(); views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); window->Close(); } diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc index 298412f..78cab40 100644 --- a/chrome/browser/ui/views/simple_message_box_views.cc +++ b/chrome/browser/ui/views/simple_message_box_views.cc @@ -64,7 +64,7 @@ bool SimpleMessageBoxViews::ShowYesNoBox(gfx::NativeWindow parent_window, bool old_state = MessageLoopForUI::current()->NestableTasksAllowed(); MessageLoopForUI::current()->SetNestableTasksAllowed(true); - MessageLoopForUI::current()->Run(dialog); + MessageLoopForUI::current()->RunWithDispatcher(dialog); MessageLoopForUI::current()->SetNestableTasksAllowed(old_state); g_browser_process->ReleaseModule(); diff --git a/chrome/browser/ui/views/user_data_dir_dialog.cc b/chrome/browser/ui/views/user_data_dir_dialog.cc index a700958..6a1c54f 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.cc +++ b/chrome/browser/ui/views/user_data_dir_dialog.cc @@ -17,7 +17,7 @@ FilePath UserDataDirDialog::RunUserDataDirDialog( const FilePath& user_data_dir) { // When the window closes, it will delete itself. UserDataDirDialog* dlg = new UserDataDirDialog(user_data_dir); - MessageLoopForUI::current()->Run(dlg); + MessageLoopForUI::current()->RunWithDispatcher(dlg); return dlg->user_data_dir(); } diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 80e2316..17ec8c5 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -232,9 +232,9 @@ void RunMessageLoop() { loop->SetNestableTasksAllowed(true); #if defined(TOOLKIT_VIEWS) views::AcceleratorHandler handler; - loop->Run(&handler); + loop->RunWithDispatcher(&handler); #elif defined(OS_POSIX) && !defined(OS_MACOSX) - loop->Run(NULL); + loop->RunWithDispatcher(NULL); #else loop->Run(); #endif diff --git a/chrome_frame/test/chrome_frame_automation_mock.cc b/chrome_frame/test/chrome_frame_automation_mock.cc index af88517..4da64bc 100644 --- a/chrome_frame/test/chrome_frame_automation_mock.cc +++ b/chrome_frame/test/chrome_frame_automation_mock.cc @@ -19,7 +19,7 @@ TEST(ChromeFrame, FLAKY_Launch) { loop.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, kLongWaitTimeout); mock_launch.Navigate("about:blank"); - loop.Run(NULL); + loop.RunWithDispatcher(NULL); EXPECT_TRUE(mock_launch.launch_result()); } @@ -30,7 +30,7 @@ TEST(ChromeFrame, Navigate) { loop.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, kLongWaitTimeout); mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html"); - loop.Run(NULL); + loop.RunWithDispatcher(NULL); EXPECT_FALSE(mock_navigate.navigation_result()); } @@ -41,7 +41,7 @@ TEST(ChromeFrame, PostMessage) { loop.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, kLongWaitTimeout); mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html"); - loop.Run(NULL); + loop.RunWithDispatcher(NULL); EXPECT_FALSE(mock_postmessage.postmessage_result()); } @@ -55,7 +55,7 @@ TEST(ChromeFrame, FLAKY_RequestStart) { loop.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, kLongWaitTimeout); mock_request_start.NavigateRelative(L"postmessage_basic_frame.html"); - loop.Run(NULL); + loop.RunWithDispatcher(NULL); EXPECT_TRUE(mock_request_start.request_start_result()); } diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index 5bccf00..c9432ae 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc @@ -355,7 +355,7 @@ void BrowserMainParts::MainMessageLoopRun() { #if defined(OS_MACOSX) MessageLoopForUI::current()->Run(); #else - MessageLoopForUI::current()->Run(NULL); + MessageLoopForUI::current()->RunWithDispatcher(NULL); #endif } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 8ff3036..e9e2992 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -95,7 +95,7 @@ gfx::NativeView RenderWidgetHostViewAura::GetNativeView() const { } gfx::NativeViewId RenderWidgetHostViewAura::GetNativeViewId() const { - return NULL; + return static_cast<gfx::NativeViewId>(NULL); } void RenderWidgetHostViewAura::MovePluginWindows( @@ -339,7 +339,7 @@ bool RenderWidgetHostViewAura::OnKeyEvent(aura::KeyEvent* event) { gfx::NativeCursor RenderWidgetHostViewAura::GetCursor(const gfx::Point& point) { // TODO(beng): talk to beng before implementing this. //NOTIMPLEMENTED(); - return NULL; + return gfx::kNullCursor; } int RenderWidgetHostViewAura::GetNonClientComponent( diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc index 5947492..7824c12 100644 --- a/ui/aura/desktop.cc +++ b/ui/aura/desktop.cc @@ -120,7 +120,7 @@ void Desktop::SetCursor(gfx::NativeCursor cursor) { void Desktop::Run() { ShowDesktop(); - MessageLoopForUI::current()->Run(host_.get()); + MessageLoopForUI::current()->RunWithDispatcher(host_.get()); } void Desktop::Draw() { diff --git a/ui/aura/desktop.h b/ui/aura/desktop.h index 34e47ee..debf1d7 100644 --- a/ui/aura/desktop.h +++ b/ui/aura/desktop.h @@ -111,9 +111,9 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate, void WindowDestroying(Window* window); // Returns the desktop's dispatcher. The result should only be passed to - // MessageLoopForUI::Run() or MessageLoopForUI::RunAllPendingWithDispatcher(), - // or used to dispatch an event by |Dispatch(const NativeEvent&)| on it. - // It must never be stored. + // MessageLoopForUI::RunWithDispatcher() or + // MessageLoopForUI::RunAllPendingWithDispatcher(), or used to dispatch + // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored. MessageLoop::Dispatcher* GetDispatcher(); // Add/remove observer. diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc index a4b0d56..359cbb7 100644 --- a/views/controls/menu/menu_controller.cc +++ b/views/controls/menu/menu_controller.cc @@ -319,7 +319,7 @@ MenuItemView* MenuController::Run(Widget* parent, MessageLoopForUI* loop = MessageLoopForUI::current(); bool did_allow_task_nesting = loop->NestableTasksAllowed(); loop->SetNestableTasksAllowed(true); - loop->Run(this); + loop->RunWithDispatcher(this); loop->SetNestableTasksAllowed(did_allow_task_nesting); if (ViewsDelegate::views_delegate) diff --git a/views/controls/menu/nested_dispatcher_gtk.cc b/views/controls/menu/nested_dispatcher_gtk.cc index 383447c..688df9b 100644 --- a/views/controls/menu/nested_dispatcher_gtk.cc +++ b/views/controls/menu/nested_dispatcher_gtk.cc @@ -20,7 +20,7 @@ bool NestedDispatcherGtk::RunAndSelfDestruct() { bool nestable = MessageLoopForUI::current()->NestableTasksAllowed(); if (allow_nested_task_) MessageLoopForUI::current()->SetNestableTasksAllowed(true); - MessageLoopForUI::current()->Run(this); + MessageLoopForUI::current()->RunWithDispatcher(this); if (allow_nested_task_) MessageLoopForUI::current()->SetNestableTasksAllowed(nestable); bool creator_is_deleted = creator_ == NULL; diff --git a/views/desktop/desktop_main.cc b/views/desktop/desktop_main.cc index 225a970..f67d23e 100644 --- a/views/desktop/desktop_main.cc +++ b/views/desktop/desktop_main.cc @@ -82,7 +82,7 @@ int main(int argc, char** argv) { gfx::Rect(600, 450, 450, 300), false); views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); #if defined(OS_WIN) OleUninitialize(); diff --git a/views/examples/examples_main.cc b/views/examples/examples_main.cc index 115bafc..15b5dfd 100644 --- a/views/examples/examples_main.cc +++ b/views/examples/examples_main.cc @@ -185,7 +185,7 @@ int main(int argc, char** argv) { main.Init(); views::AcceleratorHandler accelerator_handler; - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); #if defined(OS_WIN) OleUninitialize(); diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc index 162468d..b2497e3 100644 --- a/views/focus/focus_manager_unittest.cc +++ b/views/focus/focus_manager_unittest.cc @@ -978,7 +978,7 @@ TEST_F(FocusManagerTest, FocusStoreRestore) { view->RequestFocus(); RunPendingMessages(); - // MessageLoopForUI::current()->Run(new AcceleratorHandler()); + // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); // Visual Studio 2010 has problems converting NULL to the null pointer for // std::pair. See http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair @@ -1078,7 +1078,7 @@ TEST_F(FocusTraversalTest, NormalTraversal) { // Uncomment the following line if you want to test manually the UI of this // test. - // MessageLoopForUI::current()->Run(new AcceleratorHandler()); + // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); // Let's traverse the whole focus hierarchy (several times, to make sure it // loops OK). @@ -1131,7 +1131,7 @@ TEST_F(FocusTraversalTest, TraversalWithNonEnabledViews) { // Uncomment the following line if you want to test manually the UI of this // test. - // MessageLoopForUI::current()->Run(new AcceleratorHandler()); + // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); View* focused_view; // Let's do one traversal (several times, to make sure it loops ok). @@ -1183,7 +1183,7 @@ TEST_F(FocusTraversalTest, TraversalWithInvisibleViews) { // Uncomment the following line if you want to test manually the UI of this // test. - // MessageLoopForUI::current()->Run(new AcceleratorHandler()); + // MessageLoopForUI::current()->RunWithDispatcher(new AcceleratorHandler()); View* focused_view; // Let's do one traversal (several times, to make sure it loops ok). @@ -1514,7 +1514,7 @@ TEST_F(FocusManagerTest, IgnoreKeyupForAccelerators) { PostKeyUp(ui::VKEY_9); AcceleratorHandler accelerator_handler; MessageLoopForUI::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); // Make sure we get a key-up and key-down. ASSERT_EQ(1U, mtv->keys_pressed().size()); EXPECT_EQ(ui::VKEY_9, mtv->keys_pressed()[0]); @@ -1533,7 +1533,7 @@ TEST_F(FocusManagerTest, IgnoreKeyupForAccelerators) { PostKeyUp(ui::VKEY_7); PostKeyUp(ui::VKEY_8); MessageLoopForUI::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); // Make sure we get a key-up and key-down. ASSERT_EQ(5U, mtv->keys_pressed().size()); EXPECT_EQ(ui::VKEY_9, mtv->keys_pressed()[0]); @@ -1552,7 +1552,7 @@ TEST_F(FocusManagerTest, IgnoreKeyupForAccelerators) { PostKeyDown(ui::VKEY_0); PostKeyUp(ui::VKEY_0); MessageLoopForUI::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); EXPECT_TRUE(mtv->keys_pressed().empty()); EXPECT_TRUE(mtv->keys_released().empty()); EXPECT_TRUE(mtv->accelerator_pressed()); @@ -1567,7 +1567,7 @@ TEST_F(FocusManagerTest, IgnoreKeyupForAccelerators) { PostKeyUp(ui::VKEY_1); PostKeyUp(ui::VKEY_0); MessageLoopForUI::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); - MessageLoopForUI::current()->Run(&accelerator_handler); + MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); EXPECT_TRUE(mtv->keys_pressed().empty()); EXPECT_TRUE(mtv->keys_released().empty()); EXPECT_TRUE(mtv->accelerator_pressed()); diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc index b9995df..d344b1d 100644 --- a/views/widget/native_widget_gtk.cc +++ b/views/widget/native_widget_gtk.cc @@ -528,7 +528,7 @@ void NativeWidgetGtk::DoDrag(const OSExchangeData& data, int operation) { drag_data_ = &data_provider; // Block the caller until drag is done by running a nested message loop. - MessageLoopForUI::current()->Run(NULL); + MessageLoopForUI::current()->RunWithDispatcher(NULL); drag_data_ = NULL; |