| 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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <atlbase.h> // NOLINT | 8 #include <atlbase.h> // NOLINT |
| 9 #include <atlwin.h> // NOLINT | 9 #include <atlwin.h> // NOLINT |
| 10 #endif | 10 #endif |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } | 421 } |
| 422 | 422 |
| 423 // static | 423 // static |
| 424 int OmniboxResultView::default_icon_size_ = 0; | 424 int OmniboxResultView::default_icon_size_ = 0; |
| 425 | 425 |
| 426 gfx::ImageSkia OmniboxResultView::GetIcon() const { | 426 gfx::ImageSkia OmniboxResultView::GetIcon() const { |
| 427 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); | 427 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); |
| 428 if (!image.IsEmpty()) | 428 if (!image.IsEmpty()) |
| 429 return image.AsImageSkia(); | 429 return image.AsImageSkia(); |
| 430 | 430 |
| 431 int icon = match_.starred ? | 431 int icon = model_->IsStarredMatch(match_) ? |
| 432 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 432 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
| 433 if (GetState() == SELECTED) { | 433 if (GetState() == SELECTED) { |
| 434 switch (icon) { | 434 switch (icon) { |
| 435 case IDR_OMNIBOX_EXTENSION_APP: | 435 case IDR_OMNIBOX_EXTENSION_APP: |
| 436 icon = IDR_OMNIBOX_EXTENSION_APP_SELECTED; | 436 icon = IDR_OMNIBOX_EXTENSION_APP_SELECTED; |
| 437 break; | 437 break; |
| 438 case IDR_OMNIBOX_HTTP: | 438 case IDR_OMNIBOX_HTTP: |
| 439 icon = IDR_OMNIBOX_HTTP_SELECTED; | 439 icon = IDR_OMNIBOX_HTTP_SELECTED; |
| 440 break; | 440 break; |
| 441 case IDR_OMNIBOX_SEARCH: | 441 case IDR_OMNIBOX_SEARCH: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 555 } |
| 556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), | 556 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), |
| 557 keyword_description_rendertext_.get(), canvas, x); | 557 keyword_description_rendertext_.get(), canvas, x); |
| 558 } | 558 } |
| 559 } | 559 } |
| 560 | 560 |
| 561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 561 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
| 562 Layout(); | 562 Layout(); |
| 563 SchedulePaint(); | 563 SchedulePaint(); |
| 564 } | 564 } |
| OLD | NEW |