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

Unified Diff: ui/aura_shell/examples/window_type_launcher.cc

Issue 8120014: Add a lock screen example. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « ui/aura_shell/examples/window_type_launcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/examples/window_type_launcher.cc
===================================================================
--- ui/aura_shell/examples/window_type_launcher.cc (revision 103801)
+++ ui/aura_shell/examples/window_type_launcher.cc (working copy)
@@ -98,10 +98,13 @@
this, L"Create Non-Resizable Window"))),
ALLOW_THIS_IN_INITIALIZER_LIST(bubble_button_(
new views::NativeTextButton(this, L"Create Pointy Bubble"))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(lock_button_(
+ new views::NativeTextButton(this, L"Lock Screen"))),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
AddChildView(create_button_);
AddChildView(create_nonresizable_button_);
AddChildView(bubble_button_);
+ AddChildView(lock_button_);
set_context_menu_controller(this);
}
@@ -176,6 +179,11 @@
create_nonresizable_button_->SetBounds(
5, bubble_button_->y() - create_nr_button_ps.height() - 5,
create_nr_button_ps.width(), create_nr_button_ps.height());
+
+ gfx::Size lock_ps = lock_button_->GetPreferredSize();
+ lock_button_->SetBounds(
+ 5, create_nonresizable_button_->y() - lock_ps.height() - 5,
+ lock_ps.width(), lock_ps.height());
}
gfx::Size WindowTypeLauncher::GetPreferredSize() {
@@ -183,7 +191,7 @@
}
bool WindowTypeLauncher::OnMousePressed(const views::MouseEvent& event) {
- // Overriden so we get OnMouseReleased and can show the context menu.
+ // Overridden so we get OnMouseReleased and can show the context menu.
return true;
}
@@ -216,6 +224,8 @@
views::View::ConvertPointToWidget(bubble_button_->parent(), &origin);
origin.Offset(10, bubble_button_->height() - 10);
CreatePointyBubble(GetWidget()->GetNativeWindow(), origin);
+ } else if (sender == lock_button_) {
+ CreateLock();
}
}
« no previous file with comments | « ui/aura_shell/examples/window_type_launcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698