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/autofill/password_generation_popup_view.h" | 5 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" | 9 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" |
10 #include "chrome/browser/ui/autofill/password_generation_popup_view_tester.h" | 10 #include "chrome/browser/ui/autofill/password_generation_popup_view_tester.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/test/base/in_process_browser_test.h" | 14 #include "chrome/test/base/in_process_browser_test.h" |
| 15 #include "components/password_manager/content/browser/content_password_manager_d
river.h" |
| 16 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "ui/events/event_utils.h" | 18 #include "ui/events/event_utils.h" |
17 | 19 |
18 namespace autofill { | 20 namespace autofill { |
19 | 21 |
20 class TestPasswordGenerationPopupController : | 22 class TestPasswordGenerationPopupController : |
21 public PasswordGenerationPopupControllerImpl { | 23 public PasswordGenerationPopupControllerImpl { |
22 public: | 24 public: |
23 TestPasswordGenerationPopupController(content::WebContents* web_contents, | 25 TestPasswordGenerationPopupController(content::WebContents* web_contents, |
24 gfx::NativeView native_view) | 26 gfx::NativeView native_view) |
25 : PasswordGenerationPopupControllerImpl( | 27 : PasswordGenerationPopupControllerImpl( |
26 gfx::RectF(0, 0, 10, 10), | 28 gfx::RectF(0, 0, 10, 10), |
27 PasswordForm(), | 29 PasswordForm(), |
28 10, | 30 10, |
29 nullptr /* PasswordManager*/, | 31 nullptr /* PasswordManager*/, |
30 nullptr /* PasswordManagerDriver*/, | 32 password_manager::ContentPasswordManagerDriverFactory:: |
| 33 FromWebContents(web_contents) |
| 34 ->GetDriverForFrame(web_contents->GetMainFrame()), |
31 nullptr /* PasswordGenerationPopupObserver*/, | 35 nullptr /* PasswordGenerationPopupObserver*/, |
32 web_contents, | 36 web_contents, |
33 native_view) {} | 37 native_view) {} |
34 | 38 |
35 ~TestPasswordGenerationPopupController() override {} | 39 ~TestPasswordGenerationPopupController() override {} |
36 | 40 |
37 PasswordGenerationPopupView* view() { | 41 PasswordGenerationPopupView* view() { |
38 return view_; | 42 return view_; |
39 } | 43 } |
40 }; | 44 }; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Regression test for crbug.com/439618. | 84 // Regression test for crbug.com/439618. |
81 IN_PROC_BROWSER_TEST_F(PasswordGenerationPopupViewTest, | 85 IN_PROC_BROWSER_TEST_F(PasswordGenerationPopupViewTest, |
82 InvalidContainerView) { | 86 InvalidContainerView) { |
83 controller_ = new autofill::TestPasswordGenerationPopupController( | 87 controller_ = new autofill::TestPasswordGenerationPopupController( |
84 GetWebContents(), NULL); | 88 GetWebContents(), NULL); |
85 controller_->Show(true /* display password */); | 89 controller_->Show(true /* display password */); |
86 } | 90 } |
87 #endif | 91 #endif |
88 | 92 |
89 } // namespace autofill | 93 } // namespace autofill |
OLD | NEW |