Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "chrome/browser/ui/autofill/autofill_popup_view.h" | 7 #include "chrome/browser/ui/autofill/autofill_popup_view.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 ContentAutofillDriver::FromWebContents(web_contents_); | 80 ContentAutofillDriver::FromWebContents(web_contents_); |
| 81 autofill_external_delegate_.reset( | 81 autofill_external_delegate_.reset( |
| 82 new TestAutofillExternalDelegate( | 82 new TestAutofillExternalDelegate( |
| 83 web_contents_, | 83 web_contents_, |
| 84 driver->autofill_manager(), | 84 driver->autofill_manager(), |
| 85 driver)); | 85 driver)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Normally the WebContents will automatically delete the delegate, but here | 88 // Normally the WebContents will automatically delete the delegate, but here |
| 89 // the delegate is owned by this test, so we have to manually destroy. | 89 // the delegate is owned by this test, so we have to manually destroy. |
| 90 virtual void WebContentsDestroyed(content::WebContents* web_contents) | 90 virtual void WebContentsDestroyed() |
| 91 OVERRIDE { | 91 OVERRIDE { |
| 92 DCHECK_EQ(web_contents_, web_contents); | 92 DCHECK_EQ(web_contents_, web_contents()); |
| 93 | 93 |
| 94 autofill_external_delegate_.reset(); | 94 autofill_external_delegate_.reset(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 content::WebContents* web_contents_; | 98 content::WebContents* web_contents_; |
|
jam
2014/05/02 19:34:11
remove this as well
zverre
2014/05/05 16:40:25
Done.
| |
| 99 | 99 |
| 100 scoped_ptr<TestAutofillExternalDelegate> autofill_external_delegate_; | 100 scoped_ptr<TestAutofillExternalDelegate> autofill_external_delegate_; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 // Autofill UI isn't currently hidden on window move on Mac. | 103 // Autofill UI isn't currently hidden on window move on Mac. |
| 104 // http://crbug.com/180566 | 104 // http://crbug.com/180566 |
| 105 #if !defined(OS_MACOSX) | 105 #if !defined(OS_MACOSX) |
| 106 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, | 106 IN_PROC_BROWSER_TEST_F(AutofillPopupControllerBrowserTest, |
| 107 HidePopupOnWindowConfiguration) { | 107 HidePopupOnWindowConfiguration) { |
| 108 GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 108 GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 132 MAYBE_DeleteDelegateBeforePopupHidden){ | 132 MAYBE_DeleteDelegateBeforePopupHidden){ |
| 133 GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 133 GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
| 134 | 134 |
| 135 // Delete the external delegate here so that is gets deleted before popup is | 135 // Delete the external delegate here so that is gets deleted before popup is |
| 136 // hidden. This can happen if the web_contents are destroyed before the popup | 136 // hidden. This can happen if the web_contents are destroyed before the popup |
| 137 // is hidden. See http://crbug.com/232475 | 137 // is hidden. See http://crbug.com/232475 |
| 138 autofill_external_delegate_.reset(); | 138 autofill_external_delegate_.reset(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace autofill | 141 } // namespace autofill |
| OLD | NEW |