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

Unified Diff: ash/shell/window_type_launcher.cc

Issue 2299583003: Change buttons in WindowTypeLauncher to MdTextButton (Closed)
Patch Set: using views::MdTextButton Created 4 years, 3 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 | « ash/shell/window_type_launcher.h ('k') | mash/example/window_type_launcher/window_type_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/window_type_launcher.cc
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index 648445e136080078adbbfe6cc8f7ee5152615955..ee9d113d3af2d7bcf7a39732cd5387d633254d96 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -26,7 +26,7 @@
#include "ui/gfx/canvas.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/notification_types.h"
-#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/md_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_with_content.h"
@@ -34,6 +34,7 @@
#include "ui/views/widget/widget.h"
#include "ui/wm/core/shadow_types.h"
+using views::MdTextButton;
using views::MenuItemView;
using views::MenuRunner;
@@ -52,9 +53,8 @@ class ModalWindow : public views::WidgetDelegateView,
: modal_type_(modal_type),
color_(g_colors[g_color_index]),
open_button_(
- new views::LabelButton(this, base::ASCIIToUTF16("Moar!"))) {
+ MdTextButton::CreateMdButton(this, base::ASCIIToUTF16("Moar!"))) {
++g_color_index %= arraysize(g_colors);
- open_button_->SetStyle(views::Button::STYLE_BUTTON);
AddChildView(open_button_);
}
~ModalWindow() override {}
@@ -95,7 +95,7 @@ class ModalWindow : public views::WidgetDelegateView,
private:
ui::ModalType modal_type_;
SkColor color_;
- views::LabelButton* open_button_;
+ views::Button* open_button_;
DISALLOW_COPY_AND_ASSIGN(ModalWindow);
};
@@ -175,55 +175,44 @@ void InitWindowTypeLauncher() {
WindowTypeLauncher::WindowTypeLauncher()
: create_button_(
- new views::LabelButton(this, base::ASCIIToUTF16("Create Window"))),
+ MdTextButton::CreateMdButton(this,
+ base::ASCIIToUTF16("Create Window"))),
panel_button_(
- new views::LabelButton(this, base::ASCIIToUTF16("Create Panel"))),
- create_nonresizable_button_(new views::LabelButton(
+ MdTextButton::CreateMdButton(this,
+ base::ASCIIToUTF16("Create Panel"))),
+ create_nonresizable_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Create Non-Resizable Window"))),
- bubble_button_(
- new views::LabelButton(this,
- base::ASCIIToUTF16("Create Pointy Bubble"))),
+ bubble_button_(MdTextButton::CreateMdButton(
+ this,
+ base::ASCIIToUTF16("Create Pointy Bubble"))),
lock_button_(
- new views::LabelButton(this, base::ASCIIToUTF16("Lock Screen"))),
- widgets_button_(
- new views::LabelButton(this,
- base::ASCIIToUTF16("Show Example Widgets"))),
- system_modal_button_(new views::LabelButton(
+ MdTextButton::CreateMdButton(this,
+ base::ASCIIToUTF16("Lock Screen"))),
+ widgets_button_(MdTextButton::CreateMdButton(
+ this,
+ base::ASCIIToUTF16("Show Example Widgets"))),
+ system_modal_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Open System Modal Window"))),
- window_modal_button_(new views::LabelButton(
+ window_modal_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Open Window Modal Window"))),
- child_modal_button_(new views::LabelButton(
+ child_modal_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Open Child Modal Window"))),
- transient_button_(new views::LabelButton(
+ transient_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Open Non-Modal Transient Window"))),
- examples_button_(new views::LabelButton(
+ examples_button_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Open Views Examples Window"))),
- show_hide_window_button_(
- new views::LabelButton(this,
- base::ASCIIToUTF16("Show/Hide a Window"))),
- show_web_notification_(new views::LabelButton(
+ show_hide_window_button_(MdTextButton::CreateMdButton(
+ this,
+ base::ASCIIToUTF16("Show/Hide a Window"))),
+ show_web_notification_(MdTextButton::CreateMdButton(
this,
base::ASCIIToUTF16("Show a web/app notification"))) {
- create_button_->SetStyle(views::Button::STYLE_BUTTON);
- panel_button_->SetStyle(views::Button::STYLE_BUTTON);
- create_nonresizable_button_->SetStyle(views::Button::STYLE_BUTTON);
- bubble_button_->SetStyle(views::Button::STYLE_BUTTON);
- lock_button_->SetStyle(views::Button::STYLE_BUTTON);
- widgets_button_->SetStyle(views::Button::STYLE_BUTTON);
- system_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
- window_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
- child_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
- transient_button_->SetStyle(views::Button::STYLE_BUTTON);
- examples_button_->SetStyle(views::Button::STYLE_BUTTON);
- show_hide_window_button_->SetStyle(views::Button::STYLE_BUTTON);
- show_web_notification_->SetStyle(views::Button::STYLE_BUTTON);
-
views::GridLayout* layout = new views::GridLayout(this);
layout->SetInsets(5, 5, 5, 5);
SetLayoutManager(layout);
« no previous file with comments | « ash/shell/window_type_launcher.h ('k') | mash/example/window_type_launcher/window_type_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698