Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc |
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc |
index 378910bc9cef658552e9ff16cd5273d96559edc3..69f36e50cb726ef8fa36b3434064f0be598e43a9 100644 |
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc |
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc |
@@ -65,9 +65,7 @@ class DialogWaiter : public aura::EnvObserver, |
aura::Env::GetInstance()->AddObserver(this); |
} |
- virtual ~DialogWaiter() { |
- aura::Env::GetInstance()->RemoveObserver(this); |
- } |
+ ~DialogWaiter() override { aura::Env::GetInstance()->RemoveObserver(this); } |
views::Widget* WaitForDialog() { |
if (dialog_created_) |
@@ -82,7 +80,7 @@ class DialogWaiter : public aura::EnvObserver, |
private: |
// aura::EnvObserver: |
- virtual void OnWindowInitialized(aura::Window* window) override { |
+ void OnWindowInitialized(aura::Window* window) override { |
if (dialog_) |
return; |
views::Widget* widget = views::Widget::GetWidgetForNativeView(window); |
@@ -93,8 +91,7 @@ class DialogWaiter : public aura::EnvObserver, |
} |
// views::WidgetObserver: |
- virtual void OnWidgetVisibilityChanged(views::Widget* widget, |
- bool visible) override { |
+ void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override { |
CHECK_EQ(dialog_, widget); |
if (visible) { |
dialog_created_ = true; |
@@ -119,7 +116,7 @@ class DialogCloseWaiter : public views::WidgetObserver { |
dialog->AddObserver(this); |
} |
- virtual ~DialogCloseWaiter() { |
+ ~DialogCloseWaiter() override { |
// It is not necessary to remove |this| from the dialog's observer, since |
// the dialog is destroyed before this waiter. |
} |
@@ -136,7 +133,7 @@ class DialogCloseWaiter : public views::WidgetObserver { |
private: |
// views::WidgetObserver: |
- virtual void OnWidgetDestroyed(views::Widget* widget) override { |
+ void OnWidgetDestroyed(views::Widget* widget) override { |
dialog_closed_ = true; |
if (!quit_closure_.is_null()) |
quit_closure_.Run(); |
@@ -157,7 +154,7 @@ class TabKeyWaiter : public ui::EventHandler { |
widget_->GetNativeView()->AddPreTargetHandler(this); |
} |
- virtual ~TabKeyWaiter() { |
+ ~TabKeyWaiter() override { |
widget_->GetNativeView()->RemovePreTargetHandler(this); |
} |
@@ -173,7 +170,7 @@ class TabKeyWaiter : public ui::EventHandler { |
private: |
// ui::EventHandler: |
- virtual void OnKeyEvent(ui::KeyEvent* event) override { |
+ void OnKeyEvent(ui::KeyEvent* event) override { |
if (event->type() == ui::ET_KEY_RELEASED && |
event->key_code() == ui::VKEY_TAB) { |
received_tab_ = true; |
@@ -200,7 +197,7 @@ void MoveMouseAndPress(const gfx::Point& screen_pos, |
// PageNavigator implementation that records the URL. |
class TestingPageNavigator : public PageNavigator { |
public: |
- virtual WebContents* OpenURL(const OpenURLParams& params) override { |
+ WebContents* OpenURL(const OpenURLParams& params) override { |
url_ = params.url; |
return NULL; |
} |
@@ -254,7 +251,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { |
: ViewEventTestBase(), |
model_(NULL) {} |
- virtual void SetUp() override { |
+ void SetUp() override { |
content_client_.reset(new ChromeContentClient); |
content::SetContentClient(content_client_.get()); |
browser_content_client_.reset(new chrome::ChromeContentBrowserClient()); |
@@ -304,7 +301,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { |
ViewEventTestBase::SetUp(); |
} |
- virtual void TearDown() { |
+ void TearDown() override { |
// Destroy everything, then run the message loop to ensure we delete all |
// Tasks and fully shut down. |
browser_->tab_strip_model()->CloseAllTabs(); |
@@ -329,11 +326,9 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { |
} |
protected: |
- virtual views::View* CreateContentsView() override { |
- return bb_view_.get(); |
- } |
+ views::View* CreateContentsView() override { return bb_view_.get(); } |
- virtual gfx::Size GetPreferredSize() const override { return bb_view_pref_; } |
+ gfx::Size GetPreferredSize() const override { return bb_view_pref_; } |
views::LabelButton* GetBookmarkButton(int view_index) { |
return bb_view_->GetBookmarkButton(view_index); |
@@ -391,7 +386,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { |
// child, clicks it and makes sure a navigation occurs. |
class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -442,7 +437,7 @@ VIEW_TEST(BookmarkBarViewTest1, Basic) |
// Brings up menu, clicks on empty space and make sure menu hides. |
class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -503,7 +498,7 @@ VIEW_TEST(BookmarkBarViewTest2, MAYBE_HideOnDesktopClick) |
// another child and make sure next menu appears. |
class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::MenuButton* button = bb_view_->other_bookmarked_button(); |
@@ -584,9 +579,9 @@ class BookmarkContextMenuNotificationObserver |
content::NotificationService::AllSources()); |
} |
- virtual void Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) override { |
+ void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) override { |
base::MessageLoop::current()->PostTask(FROM_HERE, task_); |
} |
@@ -610,7 +605,7 @@ class BookmarkBarViewTest4 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -663,7 +658,7 @@ VIEW_TEST(BookmarkBarViewTest4, ContextMenus) |
// Tests drag and drop within the same menu. |
class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
url_dragging_ = |
model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url(); |
@@ -736,7 +731,7 @@ VIEW_TEST(BookmarkBarViewTest5, MAYBE(DND)) |
// then selecting an item. |
class BookmarkBarViewTest6 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Press the mouse button on the overflow button. Don't release it though. |
views::LabelButton* button = bb_view_->overflow_button(); |
ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
@@ -773,7 +768,7 @@ VIEW_TEST(BookmarkBarViewTest6, OpenMenuOnClickAndHold) |
// Tests drag and drop to different menu. |
class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
url_dragging_ = |
model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url(); |
@@ -873,7 +868,7 @@ VIEW_TEST(BookmarkBarViewTest7, MAYBE(DNDToDifferentMenu)) |
// original menu. |
class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
url_dragging_ = |
model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url(); |
@@ -981,9 +976,9 @@ VIEW_TEST(BookmarkBarViewTest8, MAYBE(DNDBackToOriginatingMenu)) |
// Moves the mouse over the scroll button and makes sure we get scrolling. |
class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual bool CreateBigMenu() override { return true; } |
+ bool CreateBigMenu() override { return true; } |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -1052,7 +1047,7 @@ VIEW_TEST(BookmarkBarViewTest9, ScrollButtonScrolls) |
// Tests up/down/left/enter key messages. |
class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -1173,7 +1168,7 @@ class BookmarkBarViewTest11 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -1253,7 +1248,7 @@ VIEW_TEST(BookmarkBarViewTest11, MAYBE_CloseMenuAfterClosingContextMenu) |
// Tests showing a modal dialog from a context menu. |
class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Open up the other folder. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
@@ -1262,7 +1257,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { |
chrome::num_bookmark_urls_before_prompting = 1; |
} |
- virtual ~BookmarkBarViewTest12() { |
+ ~BookmarkBarViewTest12() override { |
chrome::num_bookmark_urls_before_prompting = 15; |
} |
@@ -1355,7 +1350,7 @@ class BookmarkBarViewTest13 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -1439,7 +1434,7 @@ class BookmarkBarViewTest14 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// right mouse button. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -1486,7 +1481,7 @@ class BookmarkBarViewTest15 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Show the other bookmarks. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
@@ -1557,7 +1552,7 @@ VIEW_TEST(BookmarkBarViewTest15, MenuStaysVisibleAfterDelete) |
// Tests that we don't crash or get stuck if the parent of a menu is closed. |
class BookmarkBarViewTest16 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the first folder on the bookmark bar and press the |
// mouse. |
views::LabelButton* button = GetBookmarkButton(0); |
@@ -1604,7 +1599,7 @@ class BookmarkBarViewTest17 : public BookmarkBarViewEventTestBase { |
} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the other folder on the bookmark bar and press the |
// left mouse button. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -1693,7 +1688,7 @@ VIEW_TEST(BookmarkBarViewTest17, MAYBE_ContextMenus3) |
// menu appears. |
class BookmarkBarViewTest18 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the other folder on the bookmark bar and press the |
// left mouse button. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -1750,7 +1745,7 @@ VIEW_TEST(BookmarkBarViewTest18, MAYBE_BookmarkBarViewTest18_SiblingMenu) |
// the menu. |
class BookmarkBarViewTest19 : public BookmarkBarViewEventTestBase { |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Move the mouse to the other folder on the bookmark bar and press the |
// left mouse button. |
views::LabelButton* button = bb_view_->other_bookmarked_button(); |
@@ -1828,7 +1823,7 @@ class BookmarkBarViewTest20 : public BookmarkBarViewEventTestBase { |
BookmarkBarViewTest20() : test_view_(new TestViewForMenuExit) {} |
protected: |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
// Add |test_view_| next to |bb_view_|. |
views::View* parent = bb_view_->parent(); |
views::View* container_view = new ContainerViewForMenuExit; |
@@ -1884,7 +1879,7 @@ class BookmarkBarViewTest20 : public BookmarkBarViewEventTestBase { |
ContainerViewForMenuExit() { |
} |
- virtual void Layout() override { |
+ void Layout() override { |
DCHECK_EQ(2, child_count()); |
views::View* bb_view = child_at(0); |
views::View* test_view = child_at(1); |
@@ -1903,7 +1898,7 @@ class BookmarkBarViewTest20 : public BookmarkBarViewEventTestBase { |
public: |
TestViewForMenuExit() : press_count_(0) { |
} |
- virtual bool OnMousePressed(const ui::MouseEvent& event) override { |
+ bool OnMousePressed(const ui::MouseEvent& event) override { |
++press_count_; |
return true; |
} |
@@ -1938,7 +1933,7 @@ class BookmarkBarViewTest21 : public BookmarkBarViewEventTestBase { |
protected: |
// Move the mouse to the empty folder on the bookmark bar and press the |
// left mouse button. |
- virtual void DoTestOnMessageLoop() override { |
+ void DoTestOnMessageLoop() override { |
views::LabelButton* button = GetBookmarkButton(5); |
ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
ui_controls::DOWN | ui_controls::UP, |