| 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/views/omnibox/omnibox_popup_contents_view.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/search/search.h" | 7 #include "chrome/browser/search/search.h" |
| 8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
| 9 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 size_t index) const { | 281 size_t index) const { |
| 282 if (!HasMatchAt(index)) | 282 if (!HasMatchAt(index)) |
| 283 return gfx::Image(); | 283 return gfx::Image(); |
| 284 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); | 284 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 //////////////////////////////////////////////////////////////////////////////// | 287 //////////////////////////////////////////////////////////////////////////////// |
| 288 // OmniboxPopupContentsView, AnimationDelegate implementation: | 288 // OmniboxPopupContentsView, AnimationDelegate implementation: |
| 289 | 289 |
| 290 void OmniboxPopupContentsView::AnimationProgressed( | 290 void OmniboxPopupContentsView::AnimationProgressed( |
| 291 const ui::Animation* animation) { | 291 const gfx::Animation* animation) { |
| 292 // We should only be running the animation when the popup is already visible. | 292 // We should only be running the animation when the popup is already visible. |
| 293 DCHECK(popup_ != NULL); | 293 DCHECK(popup_ != NULL); |
| 294 popup_->SetBounds(GetPopupBounds()); | 294 popup_->SetBounds(GetPopupBounds()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 //////////////////////////////////////////////////////////////////////////////// | 297 //////////////////////////////////////////////////////////////////////////////// |
| 298 // OmniboxPopupContentsView, views::View overrides: | 298 // OmniboxPopupContentsView, views::View overrides: |
| 299 | 299 |
| 300 void OmniboxPopupContentsView::Layout() { | 300 void OmniboxPopupContentsView::Layout() { |
| 301 // Size our children to the available content area. | 301 // Size our children to the available content area. |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 // OpenMatch() may close the popup, which will clear the result set and, by | 513 // OpenMatch() may close the popup, which will clear the result set and, by |
| 514 // extension, |match| and its contents. So copy the relevant match out to | 514 // extension, |match| and its contents. So copy the relevant match out to |
| 515 // make sure it stays alive until the call completes. | 515 // make sure it stays alive until the call completes. |
| 516 AutocompleteMatch match = model_->result().match_at(index); | 516 AutocompleteMatch match = model_->result().match_at(index); |
| 517 omnibox_view_->OpenMatch(match, disposition, GURL(), index); | 517 omnibox_view_->OpenMatch(match, disposition, GURL(), index); |
| 518 } | 518 } |
| 519 | 519 |
| 520 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 520 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
| 521 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 521 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
| 522 } | 522 } |
| OLD | NEW |