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

Unified Diff: ui/views/examples/button_example.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
« no previous file with comments | « ui/views/examples/button_example.h ('k') | ui/views/examples/combobox_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/button_example.cc
===================================================================
--- ui/views/examples/button_example.cc (revision 111815)
+++ ui/views/examples/button_example.cc (working copy)
@@ -11,11 +11,12 @@
#include "ui/views/layout/fill_layout.h"
#include "views/view.h"
+namespace views {
namespace examples {
-ButtonExample::ButtonExample(ExamplesMain* main)
- : ExampleBase(main, "Text Button"),
- alignment_(views::TextButton::ALIGN_LEFT),
+ButtonExample::ButtonExample()
+ : ExampleBase("Text Button"),
+ alignment_(TextButton::ALIGN_LEFT),
use_native_theme_border_(false),
icon_(NULL),
count_(0) {
@@ -26,15 +27,14 @@
ButtonExample::~ButtonExample() {
}
-void ButtonExample::CreateExampleView(views::View* container) {
- views::TextButton* tb = new views::TextButton(this, ASCIIToUTF16("Button"));
+void ButtonExample::CreateExampleView(View* container) {
+ TextButton* tb = new TextButton(this, ASCIIToUTF16("Button"));
button_ = tb;
- container->SetLayoutManager(new views::FillLayout);
+ container->SetLayoutManager(new FillLayout);
container->AddChildView(button_);
}
-void ButtonExample::ButtonPressed(views::Button* sender,
- const views::Event& event) {
+void ButtonExample::ButtonPressed(Button* sender, const Event& event) {
PrintStatus("Pressed! count: %d", ++count_);
if (event.IsControlDown()) {
@@ -50,11 +50,11 @@
}
} else {
switch(button_->icon_placement()) {
- case views::TextButton::ICON_ON_LEFT:
- button_->set_icon_placement(views::TextButton::ICON_ON_RIGHT);
+ case TextButton::ICON_ON_LEFT:
+ button_->set_icon_placement(TextButton::ICON_ON_RIGHT);
break;
- case views::TextButton::ICON_ON_RIGHT:
- button_->set_icon_placement(views::TextButton::ICON_ON_LEFT);
+ case TextButton::ICON_ON_RIGHT:
+ button_->set_icon_placement(TextButton::ICON_ON_LEFT);
break;
}
}
@@ -65,14 +65,14 @@
button_->SetIcon(*icon_);
} else {
switch(alignment_) {
- case views::TextButton::ALIGN_LEFT:
- alignment_ = views::TextButton::ALIGN_CENTER;
+ case TextButton::ALIGN_LEFT:
+ alignment_ = TextButton::ALIGN_CENTER;
break;
- case views::TextButton::ALIGN_CENTER:
- alignment_ = views::TextButton::ALIGN_RIGHT;
+ case TextButton::ALIGN_CENTER:
+ alignment_ = TextButton::ALIGN_RIGHT;
break;
- case views::TextButton::ALIGN_RIGHT:
- alignment_ = views::TextButton::ALIGN_LEFT;
+ case TextButton::ALIGN_RIGHT:
+ alignment_ = TextButton::ALIGN_LEFT;
break;
}
button_->set_alignment(alignment_);
@@ -92,9 +92,9 @@
} else {
use_native_theme_border_ = !use_native_theme_border_;
if (use_native_theme_border_)
- button_->set_border(new views::TextButtonNativeThemeBorder(button_));
+ button_->set_border(new TextButtonNativeThemeBorder(button_));
else
- button_->set_border(new views::TextButtonBorder());
+ button_->set_border(new TextButtonBorder());
}
} else if (event.IsAltDown()) {
button_->SetIsDefault(!button_->is_default());
@@ -102,3 +102,4 @@
}
} // namespace examples
+} // namespace views
« no previous file with comments | « ui/views/examples/button_example.h ('k') | ui/views/examples/combobox_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698