diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 07:00:00 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 07:00:00 +0000 |
commit | bf3c149491e2bb21de8da1744db2866106d4d1dc (patch) | |
tree | 4716fb543124a7ea4b8ca29d0371ac040a2eae35 /ui | |
parent | d9285f690a7f8f5aa0c082276a0ebbbf41dcbe86 (diff) | |
download | chromium_src-bf3c149491e2bb21de8da1744db2866106d4d1dc.zip chromium_src-bf3c149491e2bb21de8da1744db2866106d4d1dc.tar.gz chromium_src-bf3c149491e2bb21de8da1744db2866106d4d1dc.tar.bz2 |
views: Migrate the cases of "new .*NativeTextButton(" to LabelButton.
BUG=155363
R=msw@chromium.org
TBR=ben@chromium.org
Review URL: https://chromiumcodereview.appspot.com/13584010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/focus/focus_manager_unittest_win.cc | 6 | ||||
-rw-r--r-- | ui/views/focus/focus_traversal_unittest.cc | 30 | ||||
-rw-r--r-- | ui/views/test/child_modal_window.cc | 4 | ||||
-rw-r--r-- | ui/views/test/child_modal_window.h | 4 | ||||
-rw-r--r-- | ui/views/view_unittest.cc | 28 |
5 files changed, 19 insertions, 53 deletions
diff --git a/ui/views/focus/focus_manager_unittest_win.cc b/ui/views/focus/focus_manager_unittest_win.cc index a826405..6dfdecd 100644 --- a/ui/views/focus/focus_manager_unittest_win.cc +++ b/ui/views/focus/focus_manager_unittest_win.cc @@ -8,7 +8,7 @@ #include "base/run_loop.h" #include "base/utf_string_conversions.h" #include "ui/base/events/event.h" -#include "ui/views/controls/button/text_button.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/focus/accelerator_handler.h" #include "ui/views/focus/focus_manager_test.h" #include "ui/views/widget/widget.h" @@ -70,8 +70,8 @@ TEST_F(FocusManagerTest, FocusStoreRestore) { // Simulate an activate, otherwise the deactivate isn't going to do anything. SimulateActivateWindow(); - NativeTextButton* button = new NativeTextButton(NULL, - ASCIIToUTF16("Press me")); + LabelButton* button = new LabelButton(NULL, ASCIIToUTF16("Press me")); + button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); View* view = new View(); view->set_focusable(true); diff --git a/ui/views/focus/focus_traversal_unittest.cc b/ui/views/focus/focus_traversal_unittest.cc index 5885af5..b8e4457 100644 --- a/ui/views/focus/focus_traversal_unittest.cc +++ b/ui/views/focus/focus_traversal_unittest.cc @@ -9,8 +9,8 @@ #include "base/utf_string_conversions.h" #include "ui/base/models/combobox_model.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/controls/combobox/combobox.h" #include "ui/views/controls/label.h" #include "ui/views/controls/link.h" @@ -104,7 +104,7 @@ class PaneView : public View, public FocusTraversable { focus_search_ = focus_search; } - // Overridden from View: + // Overridden from views::View: virtual FocusTraversable* GetPaneFocusTraversable() OVERRIDE { if (focus_search_) return this; @@ -112,8 +112,8 @@ class PaneView : public View, public FocusTraversable { return NULL; } - // Overridden from FocusTraversable: - virtual FocusSearch* GetFocusSearch() OVERRIDE { + // Overridden from views::FocusTraversable: + virtual views::FocusSearch* GetFocusSearch() OVERRIDE { return focus_search_; } virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE { @@ -359,8 +359,8 @@ void FocusTraversalTest::InitContentView() { y += label_height + gap_between_labels; - LabelButton* button = new LabelButton(NULL, ASCIIToUTF16("Click me")); - button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); + NativeTextButton* button = new NativeTextButton(NULL, + ASCIIToUTF16("Click me")); button->SetBounds(label_x, y + 10, 80, 30); button->set_id(kFruitButtonID); left_container_->AddChildView(button); @@ -455,22 +455,19 @@ void FocusTraversalTest::InitContentView() { y = 250; int width = 60; - button = new LabelButton(NULL, ASCIIToUTF16("OK")); - button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); + button = new NativeTextButton(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_NATIVE_TEXTBUTTON); + button = new NativeTextButton(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_NATIVE_TEXTBUTTON); + button = new NativeTextButton(NULL, ASCIIToUTF16("Help")); button->set_id(kHelpButtonID); GetContentsView()->AddChildView(button); button->SetBounds(290, y, width, 30); @@ -523,8 +520,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_NATIVE_TEXTBUTTON); + button = new NativeTextButton(NULL, ASCIIToUTF16("Search")); contents->AddChildView(button); button->SetBounds(112, 5, 60, 30); button->set_id(kSearchButtonID); @@ -547,13 +543,11 @@ void FocusTraversalTest::InitContentView() { contents->set_focusable(true); contents->set_background(Background::CreateSolidBackground(SK_ColorBLUE)); contents->set_id(kThumbnailContainerID); - button = new LabelButton(NULL, ASCIIToUTF16("Star")); - button->SetStyle(Button::STYLE_NATIVE_TEXTBUTTON); + button = new NativeTextButton(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_NATIVE_TEXTBUTTON); + button = new NativeTextButton(NULL, ASCIIToUTF16("SuperStar")); contents->AddChildView(button); button->SetBounds(60, 5, 100, 30); button->set_id(kThumbnailSuperStarID); diff --git a/ui/views/test/child_modal_window.cc b/ui/views/test/child_modal_window.cc index 0172f7d..266b2c6 100644 --- a/ui/views/test/child_modal_window.cc +++ b/ui/views/test/child_modal_window.cc @@ -8,7 +8,7 @@ #include "ui/aura/window.h" #include "ui/gfx/canvas.h" #include "ui/views/background.h" -#include "ui/views/controls/button/text_button.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/native/native_view_host.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/corewm/window_modality_controller.h" @@ -108,7 +108,7 @@ ui::ModalType ChildModalWindow::GetModalType() const { } ChildModalParent::ChildModalParent(gfx::NativeView context) - : ALLOW_THIS_IN_INITIALIZER_LIST(button_(new NativeTextButton( + : ALLOW_THIS_IN_INITIALIZER_LIST(button_(new LabelButton( this, ASCIIToUTF16("Show/Hide Child Modal Window")))), textfield_(new Textfield), host_(new NativeViewHost), diff --git a/ui/views/test/child_modal_window.h b/ui/views/test/child_modal_window.h index 492f32a..a38e793 100644 --- a/ui/views/test/child_modal_window.h +++ b/ui/views/test/child_modal_window.h @@ -10,7 +10,7 @@ #include "ui/views/widget/widget_observer.h" namespace views { -class NativeTextButton; +class LabelButton; class NativeViewHost; class Textfield; class View; @@ -52,7 +52,7 @@ class ChildModalParent : public WidgetDelegateView, // The button to toggle showing and hiding the child window. The child window // does not block input to this button. - NativeTextButton* button_; + LabelButton* button_; // The text field to indicate the keyboard focus. Textfield* textfield_; diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index a8c1f56..d20997f 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc @@ -1847,34 +1847,6 @@ TEST_F(ButtonDropDownTest, RegularClickTest) { } //////////////////////////////////////////////////////////////////////////////// -// View hierarchy / Visibility changes -//////////////////////////////////////////////////////////////////////////////// -/* -TEST_F(ViewTest, ChangeVisibility) { -#if defined(OS_LINUX) - // Make CRITICAL messages fatal - // TODO(oshima): we probably should enable this for entire tests on linux. - g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); -#endif - scoped_ptr<Widget> window(CreateWidget()); - window->Init(NULL, gfx::Rect(0, 0, 500, 300)); - View* root_view = window->GetRootView(); - NativeTextButton* native = new NativeTextButton(NULL, ASCIIToUTF16("Native")); - - root_view->SetContentsView(native); - native->SetVisible(true); - - root_view->RemoveChildView(native); - native->SetVisible(false); - // Change visibility to true with no widget. - native->SetVisible(true); - - root_view->SetContentsView(native); - native->SetVisible(true); -} -*/ - -//////////////////////////////////////////////////////////////////////////////// // Native view hierachy //////////////////////////////////////////////////////////////////////////////// class TestNativeViewHierarchy : public View { |