| 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 const bool is_open = popup_->IsOpen(); | 622 return popup_->IsOpen(); |
| 623 CHECK(!!GetChildViewCount() == is_open); | |
| 624 return is_open; | |
| 625 } | 623 } |
| 626 | 624 |
| 627 void AutocompletePopupContentsView::InvalidateLine(size_t line) { | 625 void AutocompletePopupContentsView::InvalidateLine(size_t line) { |
| 628 GetChildViewAt(static_cast<int>(line))->SchedulePaint(); | 626 GetChildViewAt(static_cast<int>(line))->SchedulePaint(); |
| 629 } | 627 } |
| 630 | 628 |
| 631 void AutocompletePopupContentsView::UpdatePopupAppearance() { | 629 void AutocompletePopupContentsView::UpdatePopupAppearance() { |
| 632 if (model_->result().empty()) { | 630 if (model_->result().empty()) { |
| 633 // No matches, close any existing popup. | 631 // No matches, close any existing popup. |
| 634 if (popup_->IsCreated()) { | 632 if (popup_->IsCreated()) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 // static | 868 // static |
| 871 AutocompletePopupView* AutocompletePopupView::CreatePopupView( | 869 AutocompletePopupView* AutocompletePopupView::CreatePopupView( |
| 872 const gfx::Font& font, | 870 const gfx::Font& font, |
| 873 AutocompleteEditView* edit_view, | 871 AutocompleteEditView* edit_view, |
| 874 AutocompleteEditModel* edit_model, | 872 AutocompleteEditModel* edit_model, |
| 875 Profile* profile, | 873 Profile* profile, |
| 876 const BubblePositioner* bubble_positioner) { | 874 const BubblePositioner* bubble_positioner) { |
| 877 return new AutocompletePopupContentsView(font, edit_view, edit_model, | 875 return new AutocompletePopupContentsView(font, edit_view, edit_model, |
| 878 profile, bubble_positioner); | 876 profile, bubble_positioner); |
| 879 } | 877 } |
| OLD | NEW |