OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE { | 31 virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE { |
32 popup_hidden_ = false; | 32 popup_hidden_ = false; |
33 | 33 |
34 AutofillExternalDelegate::OnPopupShown(listener); | 34 AutofillExternalDelegate::OnPopupShown(listener); |
35 } | 35 } |
36 | 36 |
37 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE { | 37 virtual void OnPopupHidden(content::KeyboardListener* listener) OVERRIDE { |
38 popup_hidden_ = true; | 38 popup_hidden_ = true; |
39 | 39 |
40 if (message_loop_runner_) | 40 if (message_loop_runner_.get()) |
41 message_loop_runner_->Quit(); | 41 message_loop_runner_->Quit(); |
42 | 42 |
43 AutofillExternalDelegate::OnPopupHidden(listener); | 43 AutofillExternalDelegate::OnPopupHidden(listener); |
44 } | 44 } |
45 | 45 |
46 void WaitForPopupHidden() { | 46 void WaitForPopupHidden() { |
47 if (popup_hidden_) | 47 if (popup_hidden_) |
48 return; | 48 return; |
49 | 49 |
50 message_loop_runner_ = new content::MessageLoopRunner; | 50 message_loop_runner_ = new content::MessageLoopRunner; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 DeleteDelegateBeforePopupHidden){ | 119 DeleteDelegateBeforePopupHidden){ |
120 GenerateTestAutofillPopup(autofill_external_delegate_.get()); | 120 GenerateTestAutofillPopup(autofill_external_delegate_.get()); |
121 | 121 |
122 // Delete the external delegate here so that is gets deleted before popup is | 122 // Delete the external delegate here so that is gets deleted before popup is |
123 // hidden. This can happen if the web_contents are destroyed before the popup | 123 // hidden. This can happen if the web_contents are destroyed before the popup |
124 // is hidden. See http://crbug.com/232475 | 124 // is hidden. See http://crbug.com/232475 |
125 autofill_external_delegate_.reset(); | 125 autofill_external_delegate_.reset(); |
126 } | 126 } |
127 | 127 |
128 } // namespace autofill | 128 } // namespace autofill |
OLD | NEW |