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

Unified Diff: ui/views/focus/focus_traversal_unittest.cc

Issue 2310213002: Update some example + test code to use MdTextButton instead of (Closed)
Patch Set: 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 | « ui/views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_traversal_unittest.cc
diff --git a/ui/views/focus/focus_traversal_unittest.cc b/ui/views/focus/focus_traversal_unittest.cc
index 4bc43614590abbd2df4adab2da15a1d6d29e3d5a..7b1d45a2528c20c178edc9193be42d3493b65250 100644
--- a/ui/views/focus/focus_traversal_unittest.cc
+++ b/ui/views/focus/focus_traversal_unittest.cc
@@ -13,6 +13,7 @@
#include "ui/views/border.h"
#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/button/radio_button.h"
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/label.h"
@@ -375,8 +376,8 @@ void FocusTraversalTest::InitContentView() {
y += label_height + gap_between_labels;
- LabelButton* button = new LabelButton(NULL, ASCIIToUTF16("Click me"));
- button->SetStyle(Button::STYLE_BUTTON);
+ LabelButton* button =
+ MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("Click me"));
button->SetBounds(label_x, y + 10, 80, 30);
button->set_id(kFruitButtonID);
left_container_->AddChildView(button);
@@ -471,22 +472,19 @@ void FocusTraversalTest::InitContentView() {
y = 250;
int width = 60;
- button = new LabelButton(NULL, ASCIIToUTF16("OK"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("OK"));
button->set_id(kOKButtonID);
button->SetIsDefault(true);
GetContentsView()->AddChildView(button);
button->SetBounds(150, y, width, 30);
- button = new LabelButton(NULL, ASCIIToUTF16("Cancel"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("Cancel"));
button->set_id(kCancelButtonID);
GetContentsView()->AddChildView(button);
button->SetBounds(220, y, width, 30);
- button = new LabelButton(NULL, ASCIIToUTF16("Help"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("Help"));
button->set_id(kHelpButtonID);
GetContentsView()->AddChildView(button);
button->SetBounds(290, y, width, 30);
@@ -539,8 +537,7 @@ void FocusTraversalTest::InitContentView() {
text_field->SetBounds(10, 10, 100, 20);
text_field->set_id(kSearchTextfieldID);
- button = new LabelButton(NULL, ASCIIToUTF16("Search"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("Search"));
contents->AddChildView(button);
button->SetBounds(112, 5, 60, 30);
button->set_id(kSearchButtonID);
@@ -563,13 +560,11 @@ void FocusTraversalTest::InitContentView() {
contents->SetFocusBehavior(View::FocusBehavior::ALWAYS);
contents->set_background(Background::CreateSolidBackground(SK_ColorBLUE));
contents->set_id(kThumbnailContainerID);
- button = new LabelButton(NULL, ASCIIToUTF16("Star"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("Star"));
contents->AddChildView(button);
button->SetBounds(5, 5, 50, 30);
button->set_id(kThumbnailStarID);
- button = new LabelButton(NULL, ASCIIToUTF16("SuperStar"));
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateMdButton(NULL, ASCIIToUTF16("SuperStar"));
contents->AddChildView(button);
button->SetBounds(60, 5, 100, 30);
button->set_id(kThumbnailSuperStarID);
« no previous file with comments | « ui/views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698