| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" | 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/color_utils.h" | 8 #include "app/gfx/color_utils.h" |
| 9 #include "app/gfx/insets.h" | 9 #include "app/gfx/insets.h" |
| 10 #include "app/gfx/path.h" | 10 #include "app/gfx/path.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 size_animation_.GetCurrentValue() * total_height_delta - 0.5); | 612 size_animation_.GetCurrentValue() * total_height_delta - 0.5); |
| 613 current_frame_bounds.set_height( | 613 current_frame_bounds.set_height( |
| 614 current_frame_bounds.height() + current_height_delta); | 614 current_frame_bounds.height() + current_height_delta); |
| 615 return current_frame_bounds; | 615 return current_frame_bounds; |
| 616 } | 616 } |
| 617 | 617 |
| 618 //////////////////////////////////////////////////////////////////////////////// | 618 //////////////////////////////////////////////////////////////////////////////// |
| 619 // AutocompletePopupContentsView, AutocompletePopupView overrides: | 619 // AutocompletePopupContentsView, AutocompletePopupView overrides: |
| 620 | 620 |
| 621 bool AutocompletePopupContentsView::IsOpen() const { | 621 bool AutocompletePopupContentsView::IsOpen() const { |
| 622 return popup_->IsOpen(); | 622 const bool is_open = popup_->IsOpen(); |
| 623 CHECK(!!GetChildViewCount() == is_open); |
| 624 return is_open; |
| 623 } | 625 } |
| 624 | 626 |
| 625 void AutocompletePopupContentsView::InvalidateLine(size_t line) { | 627 void AutocompletePopupContentsView::InvalidateLine(size_t line) { |
| 626 GetChildViewAt(static_cast<int>(line))->SchedulePaint(); | 628 GetChildViewAt(static_cast<int>(line))->SchedulePaint(); |
| 627 } | 629 } |
| 628 | 630 |
| 629 void AutocompletePopupContentsView::UpdatePopupAppearance() { | 631 void AutocompletePopupContentsView::UpdatePopupAppearance() { |
| 630 if (model_->result().empty()) { | 632 if (model_->result().empty()) { |
| 631 // No matches, close any existing popup. | 633 // No matches, close any existing popup. |
| 632 if (popup_->IsCreated()) { | 634 if (popup_->IsCreated()) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 // static | 870 // static |
| 869 AutocompletePopupView* AutocompletePopupView::CreatePopupView( | 871 AutocompletePopupView* AutocompletePopupView::CreatePopupView( |
| 870 const gfx::Font& font, | 872 const gfx::Font& font, |
| 871 AutocompleteEditView* edit_view, | 873 AutocompleteEditView* edit_view, |
| 872 AutocompleteEditModel* edit_model, | 874 AutocompleteEditModel* edit_model, |
| 873 Profile* profile, | 875 Profile* profile, |
| 874 const BubblePositioner* bubble_positioner) { | 876 const BubblePositioner* bubble_positioner) { |
| 875 return new AutocompletePopupContentsView(font, edit_view, edit_model, | 877 return new AutocompletePopupContentsView(font, edit_view, edit_model, |
| 876 profile, bubble_positioner); | 878 profile, bubble_positioner); |
| 877 } | 879 } |
| OLD | NEW |