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

Side by Side Diff: ui/views/focus/focus_manager_unittest.cc

Issue 1216673005: views::LabelButton should not call virtual methods from its constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150703-Views-ButtonBorderRefactor
Patch Set: self review Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/focus/focus_manager.h" 5 #include "ui/views/focus/focus_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 519
520 private: 520 private:
521 DtorTrackVector* dtor_tracker_; 521 DtorTrackVector* dtor_tracker_;
522 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory); 522 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory);
523 }; 523 };
524 524
525 class LabelButtonDtorTracked : public LabelButton { 525 class LabelButtonDtorTracked : public LabelButton {
526 public: 526 public:
527 LabelButtonDtorTracked(const base::string16& text, 527 LabelButtonDtorTracked(const base::string16& text,
528 DtorTrackVector* dtor_tracker) 528 DtorTrackVector* dtor_tracker)
529 : LabelButton(NULL, text), 529 : LabelButton(nullptr), dtor_tracker_(dtor_tracker) {
530 dtor_tracker_(dtor_tracker) { 530 InitAsButton(text);
531 SetStyle(STYLE_BUTTON);
532 }; 531 };
533 ~LabelButtonDtorTracked() override { 532 ~LabelButtonDtorTracked() override {
534 dtor_tracker_->push_back("LabelButtonDtorTracked"); 533 dtor_tracker_->push_back("LabelButtonDtorTracked");
535 } 534 }
536 535
537 DtorTrackVector* dtor_tracker_; 536 DtorTrackVector* dtor_tracker_;
538 }; 537 };
539 538
540 class WindowDtorTracked : public Widget { 539 class WindowDtorTracked : public Widget {
541 public: 540 public:
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView()); 870 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView());
872 871
873 // Allow focus to go to the parent, and focus backwards which should now move 872 // Allow focus to go to the parent, and focus backwards which should now move
874 // up |widget_view| (in the parent). 873 // up |widget_view| (in the parent).
875 delegate->set_should_advance_focus_to_parent(true); 874 delegate->set_should_advance_focus_to_parent(true);
876 GetFocusManager()->AdvanceFocus(true); 875 GetFocusManager()->AdvanceFocus(true);
877 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView()); 876 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView());
878 } 877 }
879 878
880 } // namespace views 879 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/focus/focus_traversal_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698