| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_samples.h" | 7 #include "base/metrics/histogram_samples.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/passwords/manage_passwords_test.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_test.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace metrics_util = password_manager::metrics_util; | 28 namespace metrics_util = password_manager::metrics_util; |
| 29 | 29 |
| 30 class ManagePasswordsBubbleViewTest : public ManagePasswordsTest { | 30 class ManagePasswordsBubbleViewTest : public ManagePasswordsTest { |
| 31 public: | 31 public: |
| 32 ManagePasswordsBubbleViewTest() {} | 32 ManagePasswordsBubbleViewTest() {} |
| 33 virtual ~ManagePasswordsBubbleViewTest() {} | 33 virtual ~ManagePasswordsBubbleViewTest() {} |
| 34 | 34 |
| 35 virtual ManagePasswordsIcon* view() OVERRIDE { | 35 virtual ManagePasswordsIcon* view() override { |
| 36 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); | 36 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); |
| 37 return browser_view->GetToolbarView() | 37 return browser_view->GetToolbarView() |
| 38 ->location_bar() | 38 ->location_bar() |
| 39 ->manage_passwords_icon_view(); | 39 ->manage_passwords_icon_view(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleViewTest); | 43 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleViewTest); |
| 44 }; | 44 }; |
| 45 | 45 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 ManagePasswordsBubbleView::ShowBubble( | 222 ManagePasswordsBubbleView::ShowBubble( |
| 223 browser()->tab_strip_model()->GetActiveWebContents(), | 223 browser()->tab_strip_model()->GetActiveWebContents(), |
| 224 ManagePasswordsBubble::AUTOMATIC); | 224 ManagePasswordsBubble::AUTOMATIC); |
| 225 EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing()); | 225 EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing()); |
| 226 TabStripModel* tab_model = browser()->tab_strip_model(); | 226 TabStripModel* tab_model = browser()->tab_strip_model(); |
| 227 EXPECT_EQ(0, tab_model->active_index()); | 227 EXPECT_EQ(0, tab_model->active_index()); |
| 228 // Back to the first tab. | 228 // Back to the first tab. |
| 229 tab_model->ActivateTabAt(1, true); | 229 tab_model->ActivateTabAt(1, true); |
| 230 EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing()); | 230 EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing()); |
| 231 } | 231 } |
| OLD | NEW |