| 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/inline_omnibox_popup_view.h" | 5 #include "chrome/browser/ui/views/omnibox/inline_omnibox_popup_view.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 10 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // InlineOmniboxPopupView, OmniboxResultViewModel implementation: | 196 // InlineOmniboxPopupView, OmniboxResultViewModel implementation: |
| 197 | 197 |
| 198 bool InlineOmniboxPopupView::IsSelectedIndex(size_t index) const { | 198 bool InlineOmniboxPopupView::IsSelectedIndex(size_t index) const { |
| 199 return index == model_->selected_line(); | 199 return index == model_->selected_line(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 bool InlineOmniboxPopupView::IsHoveredIndex(size_t index) const { | 202 bool InlineOmniboxPopupView::IsHoveredIndex(size_t index) const { |
| 203 return index == model_->hovered_line(); | 203 return index == model_->hovered_line(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 const SkBitmap* InlineOmniboxPopupView::GetIconIfExtensionMatch( | 206 gfx::Image InlineOmniboxPopupView::GetIconIfExtensionMatch( |
| 207 size_t index) const { | 207 size_t index) const { |
| 208 if (!HasMatchAt(index)) | 208 if (!HasMatchAt(index)) |
| 209 return NULL; | 209 return gfx::Image(); |
| 210 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); | 210 return model_->GetIconIfExtensionMatch(GetMatchAtIndex(index)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 //////////////////////////////////////////////////////////////////////////////// | 213 //////////////////////////////////////////////////////////////////////////////// |
| 214 // InlineOmniboxPopupView, AnimationDelegate implementation: | 214 // InlineOmniboxPopupView, AnimationDelegate implementation: |
| 215 | 215 |
| 216 void InlineOmniboxPopupView::AnimationProgressed( | 216 void InlineOmniboxPopupView::AnimationProgressed( |
| 217 const ui::Animation* animation) { | 217 const ui::Animation* animation) { |
| 218 // We should only be running the animation when the popup is already visible. | 218 // We should only be running the animation when the popup is already visible. |
| 219 DCHECK(visible()); | 219 DCHECK(visible()); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 if (HasMatchAt(index) && should_set_selected_line) | 386 if (HasMatchAt(index) && should_set_selected_line) |
| 387 model_->SetSelectedLine(index, false, false); | 387 model_->SetSelectedLine(index, false, false); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void InlineOmniboxPopupView::OpenSelectedLine( | 390 void InlineOmniboxPopupView::OpenSelectedLine( |
| 391 const ui::LocatedEvent& event, | 391 const ui::LocatedEvent& event, |
| 392 WindowOpenDisposition disposition) { | 392 WindowOpenDisposition disposition) { |
| 393 size_t index = GetIndexForPoint(event.location()); | 393 size_t index = GetIndexForPoint(event.location()); |
| 394 OpenIndex(index, disposition); | 394 OpenIndex(index, disposition); |
| 395 } | 395 } |
| OLD | NEW |