| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 422 } |
| 423 | 423 |
| 424 // static | 424 // static |
| 425 int OmniboxResultView::default_icon_size_ = 0; | 425 int OmniboxResultView::default_icon_size_ = 0; |
| 426 | 426 |
| 427 gfx::ImageSkia OmniboxResultView::GetIcon() const { | 427 gfx::ImageSkia OmniboxResultView::GetIcon() const { |
| 428 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); | 428 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); |
| 429 if (!image.IsEmpty()) | 429 if (!image.IsEmpty()) |
| 430 return image.AsImageSkia(); | 430 return image.AsImageSkia(); |
| 431 | 431 |
| 432 int icon = match_.starred ? | 432 int icon = model_->IsStarredMatch(match_) ? |
| 433 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 433 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
| 434 if (GetState() == SELECTED) { | 434 if (GetState() == SELECTED) { |
| 435 switch (icon) { | 435 switch (icon) { |
| 436 case IDR_OMNIBOX_EXTENSION_APP: | 436 case IDR_OMNIBOX_EXTENSION_APP: |
| 437 icon = IDR_OMNIBOX_EXTENSION_APP_SELECTED; | 437 icon = IDR_OMNIBOX_EXTENSION_APP_SELECTED; |
| 438 break; | 438 break; |
| 439 case IDR_OMNIBOX_HTTP: | 439 case IDR_OMNIBOX_HTTP: |
| 440 icon = IDR_OMNIBOX_HTTP_SELECTED; | 440 icon = IDR_OMNIBOX_HTTP_SELECTED; |
| 441 break; | 441 break; |
| 442 case IDR_OMNIBOX_SEARCH: | 442 case IDR_OMNIBOX_SEARCH: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), | 557 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), |
| 558 keyword_description_rendertext_.get(), canvas, x); | 558 keyword_description_rendertext_.get(), canvas, x); |
| 559 } | 559 } |
| 560 } | 560 } |
| 561 | 561 |
| 562 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 562 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
| 563 Layout(); | 563 Layout(); |
| 564 SchedulePaint(); | 564 SchedulePaint(); |
| 565 } | 565 } |
| OLD | NEW |