| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // Add room for the popup border. | 600 // Add room for the popup border. |
| 601 row_size += 2 * kPopupBorderThickness; | 601 row_size += 2 * kPopupBorderThickness; |
| 602 | 602 |
| 603 return row_size; | 603 return row_size; |
| 604 } | 604 } |
| 605 | 605 |
| 606 void AutofillPopupControllerImpl::UpdatePopupBounds() { | 606 void AutofillPopupControllerImpl::UpdatePopupBounds() { |
| 607 int popup_required_width = GetDesiredPopupWidth(); | 607 int popup_required_width = GetDesiredPopupWidth(); |
| 608 int popup_height = GetDesiredPopupHeight(); | 608 int popup_height = GetDesiredPopupHeight(); |
| 609 | 609 |
| 610 popup_bounds_ = controller_common_->GetPopupBounds(popup_height, | 610 popup_bounds_ = controller_common_->GetPopupBounds(popup_required_width, |
| 611 popup_required_width); | 611 popup_height); |
| 612 } | 612 } |
| 613 #endif // !defined(OS_ANDROID) | 613 #endif // !defined(OS_ANDROID) |
| 614 | 614 |
| 615 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() { | 615 WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetWeakPtr() { |
| 616 return weak_ptr_factory_.GetWeakPtr(); | 616 return weak_ptr_factory_.GetWeakPtr(); |
| 617 } | 617 } |
| 618 | 618 |
| 619 void AutofillPopupControllerImpl::ClearState() { | 619 void AutofillPopupControllerImpl::ClearState() { |
| 620 // Don't clear view_, because otherwise the popup will have to get regenerated | 620 // Don't clear view_, because otherwise the popup will have to get regenerated |
| 621 // and this will cause flickering. | 621 // and this will cause flickering. |
| 622 | 622 |
| 623 popup_bounds_ = gfx::Rect(); | 623 popup_bounds_ = gfx::Rect(); |
| 624 | 624 |
| 625 names_.clear(); | 625 names_.clear(); |
| 626 subtexts_.clear(); | 626 subtexts_.clear(); |
| 627 icons_.clear(); | 627 icons_.clear(); |
| 628 identifiers_.clear(); | 628 identifiers_.clear(); |
| 629 full_names_.clear(); | 629 full_names_.clear(); |
| 630 | 630 |
| 631 selected_line_ = kNoSelection; | 631 selected_line_ = kNoSelection; |
| 632 } | 632 } |
| 633 | 633 |
| 634 } // namespace autofill | 634 } // namespace autofill |
| OLD | NEW |