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

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

Issue 8687013: Get the examples to run in aura_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Index: ui/aura_shell/examples/window_type_launcher.cc
===================================================================
--- ui/aura_shell/examples/window_type_launcher.cc (revision 111708)
+++ ui/aura_shell/examples/window_type_launcher.cc (working copy)
@@ -16,6 +16,7 @@
#include "ui/views/controls/button/text_button.h"
#include "ui/views/controls/menu/menu_item_view.h"
#include "ui/views/controls/menu/menu_runner.h"
+#include "ui/views/examples/examples_window.h"
#include "ui/views/widget/widget.h"
using views::MenuItemView;
@@ -165,7 +166,10 @@
this, ASCIIToUTF16("Open Modal Window")))),
ALLOW_THIS_IN_INITIALIZER_LIST(transient_button_(
new views::NativeTextButton(
- this, ASCIIToUTF16("Open Non-Modal Transient Window")))) {
+ this, ASCIIToUTF16("Open Non-Modal Transient Window")))),
+ ALLOW_THIS_IN_INITIALIZER_LIST(examples_button_(
+ new views::NativeTextButton(
+ this, ASCIIToUTF16("Open Views Examples Window")))) {
AddChildView(create_button_);
AddChildView(create_nonresizable_button_);
AddChildView(bubble_button_);
@@ -173,6 +177,7 @@
AddChildView(widgets_button_);
AddChildView(modal_button_);
AddChildView(transient_button_);
+ AddChildView(examples_button_);
set_context_menu_controller(this);
}
@@ -220,6 +225,11 @@
transient_button_->SetBounds(
5, modal_button_->y() - transient_ps.height() - 5,
transient_ps.width(), transient_ps.height());
+
+ gfx::Size examples_ps = examples_button_->GetPreferredSize();
+ examples_button_->SetBounds(
+ 5, transient_button_->y() - examples_ps.height() - 5,
+ examples_ps.width(), examples_ps.height());
}
gfx::Size WindowTypeLauncher::GetPreferredSize() {
@@ -265,6 +275,8 @@
ModalWindow::OpenModalWindow(GetWidget()->GetNativeView());
} else if (sender == transient_button_) {
NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView());
+ } else if (sender == examples_button_) {
+ views::examples::ShowExamplesWindow(false);
}
}

Powered by Google App Engine
This is Rietveld 408576698