| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/browser/search/search.h" | 9 #include "chrome/browser/search/search.h" |
| 10 #include "chrome/browser/themes/theme_properties.h" | 10 #include "chrome/browser/themes/theme_properties.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 return index == model_->hovered_line(); | 263 return index == model_->hovered_line(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 gfx::Image OmniboxPopupContentsView::GetIconIfExtensionMatch( | 266 gfx::Image OmniboxPopupContentsView::GetIconIfExtensionMatch( |
| 267 size_t index) const { | 267 size_t index) const { |
| 268 if (!HasMatchAt(index)) | 268 if (!HasMatchAt(index)) |
| 269 return gfx::Image(); | 269 return gfx::Image(); |
| 270 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); | 270 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool OmniboxPopupContentsView::IsStarredMatch( |
| 274 const AutocompleteMatch& match) const { |
| 275 return model_->IsStarredMatch(match); |
| 276 } |
| 277 |
| 273 //////////////////////////////////////////////////////////////////////////////// | 278 //////////////////////////////////////////////////////////////////////////////// |
| 274 // OmniboxPopupContentsView, AnimationDelegate implementation: | 279 // OmniboxPopupContentsView, AnimationDelegate implementation: |
| 275 | 280 |
| 276 void OmniboxPopupContentsView::AnimationProgressed( | 281 void OmniboxPopupContentsView::AnimationProgressed( |
| 277 const gfx::Animation* animation) { | 282 const gfx::Animation* animation) { |
| 278 // We should only be running the animation when the popup is already visible. | 283 // We should only be running the animation when the popup is already visible. |
| 279 DCHECK(popup_ != NULL); | 284 DCHECK(popup_ != NULL); |
| 280 popup_->SetBounds(GetPopupBounds()); | 285 popup_->SetBounds(GetPopupBounds()); |
| 281 } | 286 } |
| 282 | 287 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 size_t index = GetIndexForPoint(event.location()); | 501 size_t index = GetIndexForPoint(event.location()); |
| 497 if (!HasMatchAt(index)) | 502 if (!HasMatchAt(index)) |
| 498 return; | 503 return; |
| 499 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, | 504 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, |
| 500 GURL(), base::string16(), index); | 505 GURL(), base::string16(), index); |
| 501 } | 506 } |
| 502 | 507 |
| 503 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { | 508 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { |
| 504 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); | 509 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); |
| 505 } | 510 } |
| OLD | NEW |