summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/shell/shell_main.cc3
-rw-r--r--ui/aura/demo/demo_main.cc3
-rw-r--r--ui/aura/root_window.cc5
-rw-r--r--ui/aura/root_window.h3
4 files changed, 10 insertions, 4 deletions
diff --git a/ash/shell/shell_main.cc b/ash/shell/shell_main.cc
index 6e89f9b..9d34bdf 100644
--- a/ash/shell/shell_main.cc
+++ b/ash/shell/shell_main.cc
@@ -251,8 +251,7 @@ int main(int argc, char** argv) {
ash::shell::InitWindowTypeLauncher();
- ash::Shell::GetRootWindow()->ShowRootWindow();
- MessageLoopForUI::current()->Run();
+ ash::Shell::GetRootWindow()->Run();
window_watcher.reset();
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index 48f2e8d..2882032 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -115,8 +115,7 @@ int main(int argc, char** argv) {
window3.Show();
window3.SetParent(&window2);
- aura::RootWindow::GetInstance()->ShowRootWindow();
- MessageLoopForUI::current()->Run();
+ aura::RootWindow::GetInstance()->Run();
ui::CompositorTestSupport::Terminate();
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 36ee2cd..2e110a7 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -138,6 +138,11 @@ bool RootWindow::ConfineCursorToWindow() {
return host_->ConfineCursorToRootWindow();
}
+void RootWindow::Run() {
+ ShowRootWindow();
+ MessageLoopForUI::current()->Run();
+}
+
void RootWindow::Draw() {
if (waiting_on_compositing_end_) {
draw_on_compositing_end_ = true;
diff --git a/ui/aura/root_window.h b/ui/aura/root_window.h
index d28a22f..1f999aa 100644
--- a/ui/aura/root_window.h
+++ b/ui/aura/root_window.h
@@ -99,6 +99,9 @@ class AURA_EXPORT RootWindow : public ui::CompositorDelegate,
// using this function. Returns true if successful.
bool ConfineCursorToWindow();
+ // Shows the root window host and runs an event loop for it.
+ void Run();
+
// Draws the necessary set of windows.
void Draw();