diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-04 00:30:59 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-04 00:30:59 +0000 |
commit | a47d6effd9e5a44cf5bfccf5e7e684b6960a3734 (patch) | |
tree | 8b7c7997a0300195f13ef6809cde8692c9fcfb7a /ash | |
parent | 94af172410caa0abf9449dbf169fbb9cfd7ca2ed (diff) | |
download | chromium_src-a47d6effd9e5a44cf5bfccf5e7e684b6960a3734.zip chromium_src-a47d6effd9e5a44cf5bfccf5e7e684b6960a3734.tar.gz chromium_src-a47d6effd9e5a44cf5bfccf5e7e684b6960a3734.tar.bz2 |
views: Migrate ash_shell buttons to LabelButton
BUG=155363
R=msw@chromium.org
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12390049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/shell/lock_view.cc | 7 | ||||
-rw-r--r-- | ash/shell/widgets.cc | 12 | ||||
-rw-r--r-- | ash/shell/window_type_launcher.cc | 53 | ||||
-rw-r--r-- | ash/shell/window_type_launcher.h | 32 | ||||
-rw-r--r-- | ash/system/date/tray_date.cc | 1 | ||||
-rw-r--r-- | ash/system/power/tray_power.cc | 1 |
6 files changed, 62 insertions, 44 deletions
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc index 16895c6..5390ea7 100644 --- a/ash/shell/lock_view.cc +++ b/ash/shell/lock_view.cc @@ -11,7 +11,7 @@ #include "ui/aura/window.h" #include "ui/gfx/canvas.h" #include "ui/gfx/font.h" -#include "ui/views/controls/button/text_button.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/corewm/tooltip_controller.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -25,7 +25,8 @@ class LockView : public views::WidgetDelegateView, public views::ButtonListener { public: LockView() : unlock_button_(ALLOW_THIS_IN_INITIALIZER_LIST( - new views::NativeTextButton(this, ASCIIToUTF16("Unlock")))) { + new views::LabelButton(this, ASCIIToUTF16("Unlock")))) { + unlock_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(unlock_button_); unlock_button_->set_focusable(true); } @@ -74,7 +75,7 @@ class LockView : public views::WidgetDelegateView, } gfx::Font font_; - views::NativeTextButton* unlock_button_; + views::LabelButton* unlock_button_; DISALLOW_COPY_AND_ASSIGN(LockView); }; diff --git a/ash/shell/widgets.cc b/ash/shell/widgets.cc index e83a603..234e5e3 100644 --- a/ash/shell/widgets.cc +++ b/ash/shell/widgets.cc @@ -8,8 +8,8 @@ #include "ui/aura/window.h" #include "ui/gfx/canvas.h" #include "ui/views/controls/button/checkbox.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/radio_button.h" -#include "ui/views/controls/button/text_button.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" @@ -40,8 +40,8 @@ class WidgetsWindow : public views::WidgetDelegateView { virtual bool CanResize() const OVERRIDE; private: - views::NativeTextButton* button_; - views::NativeTextButton* disabled_button_; + views::LabelButton* button_; + views::LabelButton* disabled_button_; views::Checkbox* checkbox_; views::Checkbox* checkbox_disabled_; views::Checkbox* checkbox_checked_; @@ -53,9 +53,9 @@ class WidgetsWindow : public views::WidgetDelegateView { }; WidgetsWindow::WidgetsWindow() - : button_(new views::NativeTextButton(NULL, ASCIIToUTF16("Button"))), + : button_(new views::LabelButton(NULL, ASCIIToUTF16("Button"))), disabled_button_( - new views::NativeTextButton(NULL, ASCIIToUTF16("Disabled button"))), + new views::LabelButton(NULL, ASCIIToUTF16("Disabled button"))), checkbox_(new views::Checkbox(ASCIIToUTF16("Checkbox"))), checkbox_disabled_(new views::Checkbox( ASCIIToUTF16("Checkbox disabled"))), @@ -69,8 +69,10 @@ WidgetsWindow::WidgetsWindow() ASCIIToUTF16("Radio button selected"), 0)), radio_button_selected_disabled_(new views::RadioButton( ASCIIToUTF16("Radio button selected disabled"), 1)) { + button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(button_); disabled_button_->SetEnabled(false); + disabled_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(disabled_button_); AddChildView(checkbox_); checkbox_disabled_->SetEnabled(false); diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc index a853a64b..4a9b677 100644 --- a/ash/shell/window_type_launcher.cc +++ b/ash/shell/window_type_launcher.cc @@ -23,7 +23,7 @@ #include "ui/compositor/layer.h" #include "ui/gfx/canvas.h" #include "ui/message_center/notification_types.h" -#include "ui/views/controls/button/text_button.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/corewm/shadow_types.h" @@ -53,8 +53,9 @@ class ModalWindow : public views::WidgetDelegateView, : modal_type_(modal_type), color_(g_colors[g_color_index]), ALLOW_THIS_IN_INITIALIZER_LIST(open_button_( - new views::NativeTextButton(this, ASCIIToUTF16("Moar!")))) { + new views::LabelButton(this, ASCIIToUTF16("Moar!")))) { ++g_color_index %= arraysize(g_colors); + open_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); AddChildView(open_button_); } virtual ~ModalWindow() { @@ -107,7 +108,7 @@ class ModalWindow : public views::WidgetDelegateView, private: ui::ModalType modal_type_; SkColor color_; - views::NativeTextButton* open_button_; + views::LabelButton* open_button_; DISALLOW_COPY_AND_ASSIGN(ModalWindow); }; @@ -198,47 +199,63 @@ void InitWindowTypeLauncher() { WindowTypeLauncher::WindowTypeLauncher() : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_( - new views::NativeTextButton(this, ASCIIToUTF16("Create Window")))), + new views::LabelButton(this, ASCIIToUTF16("Create Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Create Persistant Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(panel_button_( - new views::NativeTextButton(this, ASCIIToUTF16("Create Panel")))), + new views::LabelButton(this, ASCIIToUTF16("Create Panel")))), ALLOW_THIS_IN_INITIALIZER_LIST(create_nonresizable_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Create Non-Resizable Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(bubble_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Create Pointy Bubble")))), ALLOW_THIS_IN_INITIALIZER_LIST(lock_button_( - new views::NativeTextButton(this, ASCIIToUTF16("Lock Screen")))), + new views::LabelButton(this, ASCIIToUTF16("Lock Screen")))), ALLOW_THIS_IN_INITIALIZER_LIST(widgets_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Show Example Widgets")))), ALLOW_THIS_IN_INITIALIZER_LIST(system_modal_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Open System Modal Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(window_modal_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Open Window Modal Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(child_modal_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Open Child Modal Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(transient_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Open Non-Modal Transient Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(examples_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Open Views Examples Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(show_hide_window_button_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Show/Hide a Window")))), ALLOW_THIS_IN_INITIALIZER_LIST(show_screensaver_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]")))), ALLOW_THIS_IN_INITIALIZER_LIST(show_web_notification_( - new views::NativeTextButton( + new views::LabelButton( this, ASCIIToUTF16("Show a web/app notification")))) { + create_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + create_persistant_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + panel_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + create_nonresizable_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + bubble_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + lock_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + widgets_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + system_modal_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + window_modal_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + child_modal_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + transient_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + examples_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + show_hide_window_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + show_screensaver_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + show_web_notification_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); + views::GridLayout* layout = new views::GridLayout(this); layout->SetInsets(5, 5, 5, 5); SetLayoutManager(layout); diff --git a/ash/shell/window_type_launcher.h b/ash/shell/window_type_launcher.h index 0bf598b..881ce88 100644 --- a/ash/shell/window_type_launcher.h +++ b/ash/shell/window_type_launcher.h @@ -12,7 +12,7 @@ namespace views { class MenuRunner; -class NativeTextButton; +class LabelButton; } namespace ash { @@ -64,21 +64,21 @@ class WindowTypeLauncher : public views::WidgetDelegateView, const gfx::Point& point) OVERRIDE; #endif // !defined(OS_MACOSX) - views::NativeTextButton* create_button_; - views::NativeTextButton* create_persistant_button_; - views::NativeTextButton* panel_button_; - views::NativeTextButton* create_nonresizable_button_; - views::NativeTextButton* bubble_button_; - views::NativeTextButton* lock_button_; - views::NativeTextButton* widgets_button_; - views::NativeTextButton* system_modal_button_; - views::NativeTextButton* window_modal_button_; - views::NativeTextButton* child_modal_button_; - views::NativeTextButton* transient_button_; - views::NativeTextButton* examples_button_; - views::NativeTextButton* show_hide_window_button_; - views::NativeTextButton* show_screensaver_; - views::NativeTextButton* show_web_notification_; + views::LabelButton* create_button_; + views::LabelButton* create_persistant_button_; + views::LabelButton* panel_button_; + views::LabelButton* create_nonresizable_button_; + views::LabelButton* bubble_button_; + views::LabelButton* lock_button_; + views::LabelButton* widgets_button_; + views::LabelButton* system_modal_button_; + views::LabelButton* window_modal_button_; + views::LabelButton* child_modal_button_; + views::LabelButton* transient_button_; + views::LabelButton* examples_button_; + views::LabelButton* show_hide_window_button_; + views::LabelButton* show_screensaver_; + views::LabelButton* show_web_notification_; #if !defined(OS_MACOSX) scoped_ptr<views::MenuRunner> menu_runner_; #endif diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc index 4d7ef6f..c603b26 100644 --- a/ash/system/date/tray_date.cc +++ b/ash/system/date/tray_date.cc @@ -29,7 +29,6 @@ #include "ui/gfx/image/image_skia.h" #include "ui/gfx/size.h" #include "ui/views/controls/button/button.h" -#include "ui/views/controls/button/text_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" diff --git a/ash/system/power/tray_power.cc b/ash/system/power/tray_power.cc index d84e760..024ccef 100644 --- a/ash/system/power/tray_power.cc +++ b/ash/system/power/tray_power.cc @@ -30,7 +30,6 @@ #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/size.h" #include "ui/views/controls/button/button.h" -#include "ui/views/controls/button/text_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" |