OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/autofill_popup_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 // static | 69 // static |
70 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate( | 70 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate( |
71 WeakPtr<AutofillPopupControllerImpl> previous, | 71 WeakPtr<AutofillPopupControllerImpl> previous, |
72 WeakPtr<AutofillPopupDelegate> delegate, | 72 WeakPtr<AutofillPopupDelegate> delegate, |
73 content::WebContents* web_contents, | 73 content::WebContents* web_contents, |
74 gfx::NativeView container_view, | 74 gfx::NativeView container_view, |
75 const gfx::RectF& element_bounds, | 75 const gfx::RectF& element_bounds, |
76 base::i18n::TextDirection text_direction) { | 76 base::i18n::TextDirection text_direction) { |
77 DCHECK(!previous.get() || previous->delegate_.get() == delegate.get()); | |
78 | |
79 if (previous.get() && previous->web_contents() == web_contents && | 77 if (previous.get() && previous->web_contents() == web_contents && |
| 78 previous->delegate_.get() == delegate.get() && |
80 previous->container_view() == container_view && | 79 previous->container_view() == container_view && |
81 previous->element_bounds() == element_bounds) { | 80 previous->element_bounds() == element_bounds) { |
82 previous->ClearState(); | 81 previous->ClearState(); |
83 return previous; | 82 return previous; |
84 } | 83 } |
85 | 84 |
86 if (previous.get()) | 85 if (previous.get()) |
87 previous->Hide(); | 86 previous->Hide(); |
88 | 87 |
89 AutofillPopupControllerImpl* controller = | 88 AutofillPopupControllerImpl* controller = |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 names_.clear(); | 625 names_.clear(); |
627 subtexts_.clear(); | 626 subtexts_.clear(); |
628 icons_.clear(); | 627 icons_.clear(); |
629 identifiers_.clear(); | 628 identifiers_.clear(); |
630 full_names_.clear(); | 629 full_names_.clear(); |
631 | 630 |
632 selected_line_ = kNoSelection; | 631 selected_line_ = kNoSelection; |
633 } | 632 } |
634 | 633 |
635 } // namespace autofill | 634 } // namespace autofill |
OLD | NEW |