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

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

Issue 1637113003: Add simplistic screenlock application. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 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/BUILD.gn ('k') | mash/screenlock/BUILD.gn » ('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 06812a6c96e8cb51fdbb7e84c1a75e106e6b1ef5..dbf3802eaaf31fb493468f927596f78f2f27038b 100644
--- a/mash/example/window_type_launcher/window_type_launcher.cc
+++ b/mash/example/window_type_launcher/window_type_launcher.cc
@@ -6,6 +6,7 @@
#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
+#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"
@@ -163,8 +164,9 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
public views::MenuDelegate,
public views::ContextMenuController {
public:
- WindowTypeLauncherView()
- : create_button_(new views::LabelButton(
+ explicit WindowTypeLauncherView(mojo::ApplicationImpl* app)
+ : app_(app),
+ create_button_(new views::LabelButton(
this, base::ASCIIToUTF16("Create Window"))),
panel_button_(new views::LabelButton(
this, base::ASCIIToUTF16("Create Panel"))),
@@ -271,7 +273,9 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
NOTIMPLEMENTED();
}
else if (sender == lock_button_) {
- NOTIMPLEMENTED();
+ mash::shell::mojom::ShellPtr shell;
+ app_->ConnectToService("mojo:mash_shell", &shell);
+ shell->LockScreen();
}
else if (sender == widgets_button_) {
NOTIMPLEMENTED();
@@ -327,6 +331,7 @@ class WindowTypeLauncherView : public views::WidgetDelegateView,
}
}
+ mojo::ApplicationImpl* app_;
views::LabelButton* create_button_;
views::LabelButton* panel_button_;
views::LabelButton* create_nonresizable_button_;
@@ -362,7 +367,7 @@ void WindowTypeLauncher::Initialize(mojo::ApplicationImpl* app) {
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
- params.delegate = new WindowTypeLauncherView;
+ params.delegate = new WindowTypeLauncherView(app);
widget->Init(params);
widget->Show();
}
« no previous file with comments | « mash/example/window_type_launcher/BUILD.gn ('k') | mash/screenlock/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698