Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: mash/example/window_type_launcher/window_type_launcher.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mash/example/window_type_launcher/window_type_launcher.h ('k') | mash/quick_launch/quick_launch.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/example/window_type_launcher/window_type_launcher.cc
diff --git a/mash/example/window_type_launcher/window_type_launcher.cc b/mash/example/window_type_launcher/window_type_launcher.cc
index dc88bd4a0f83b7369b6bc4b693a368a06ababd64..6f4d5b14910efba936b91236f601357cf0aca087 100644
--- a/mash/example/window_type_launcher/window_type_launcher.cc
+++ b/mash/example/window_type_launcher/window_type_launcher.cc
@@ -9,7 +9,7 @@
#include "mash/shell/public/interfaces/shell.mojom.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/shell/public/cpp/application_connection.h"
-#include "mojo/shell/public/cpp/application_impl.h"
+#include "mojo/shell/public/cpp/shell.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/compositor/layer.h"
@@ -164,8 +164,8 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
public views::MenuDelegate,
public views::ContextMenuController {
public:
- explicit WindowTypeLauncherView(mojo::ApplicationImpl* app)
- : app_(app),
+ explicit WindowTypeLauncherView(mojo::Shell* shell)
+ : shell_(shell),
create_button_(new views::LabelButton(
this, base::ASCIIToUTF16("Create Window"))),
panel_button_(new views::LabelButton(
@@ -274,7 +274,7 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
}
else if (sender == lock_button_) {
mash::shell::mojom::ShellPtr shell;
- app_->ConnectToService("mojo:mash_shell", &shell);
+ shell_->ConnectToService("mojo:mash_shell", &shell);
shell->LockScreen();
}
else if (sender == widgets_button_) {
@@ -331,7 +331,7 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
}
}
- mojo::ApplicationImpl* app_;
+ mojo::Shell* shell_;
views::LabelButton* create_button_;
views::LabelButton* panel_button_;
views::LabelButton* create_nonresizable_button_;
@@ -360,14 +360,15 @@ bool WindowTypeLauncher::AcceptConnection(
return false;
}
-void WindowTypeLauncher::Initialize(mojo::ApplicationImpl* app) {
- aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak"));
+void WindowTypeLauncher::Initialize(mojo::Shell* shell, const std::string& url,
+ uint32_t id) {
+ aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak"));
- views::WindowManagerConnection::Create(app);
+ views::WindowManagerConnection::Create(shell);
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
- params.delegate = new WindowTypeLauncherView(app);
+ params.delegate = new WindowTypeLauncherView(shell);
widget->Init(params);
widget->Show();
}
« no previous file with comments | « mash/example/window_type_launcher/window_type_launcher.h ('k') | mash/quick_launch/quick_launch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698