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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 const char* OmniboxResultView::GetClassName() const { | 566 const char* OmniboxResultView::GetClassName() const { |
567 return "OmniboxResultView"; | 567 return "OmniboxResultView"; |
568 } | 568 } |
569 | 569 |
570 gfx::ImageSkia OmniboxResultView::GetIcon() const { | 570 gfx::ImageSkia OmniboxResultView::GetIcon() const { |
571 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); | 571 const gfx::Image image = model_->GetIconIfExtensionMatch(model_index_); |
572 if (!image.IsEmpty()) | 572 if (!image.IsEmpty()) |
573 return image.AsImageSkia(); | 573 return image.AsImageSkia(); |
574 | 574 |
575 if (ui::MaterialDesignController::IsModeMaterial()) { | 575 if (ui::MaterialDesignController::IsModeMaterial()) { |
576 gfx::VectorIconId icon_id = model_->IsStarredMatch(match_) ? | 576 gfx::VectorIconId icon_id = |
577 gfx::VectorIconId::OMNIBOX_STAR : | 577 model_->IsStarredMatch(match_) |
578 AutocompleteMatch::TypeToVectorIcon(match_.type); | 578 ? gfx::VectorIconId::OMNIBOX_STAR |
579 : AutocompleteMatch::TypeToVectorIcon(match_.type); | |
Peter Kasting
2015/10/21 19:45:47
I'd rather not touch this file just to change the
Evan Stade
2015/10/21 23:20:01
indeed, git cl format quirk. reverted
| |
579 return gfx::CreateVectorIcon(icon_id, 16, gfx::kChromeIconGrey); | 580 return gfx::CreateVectorIcon(icon_id, 16, gfx::kChromeIconGrey); |
580 } | 581 } |
581 | 582 |
582 int icon = model_->IsStarredMatch(match_) ? | 583 int icon = model_->IsStarredMatch(match_) ? |
583 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); | 584 IDR_OMNIBOX_STAR : AutocompleteMatch::TypeToIcon(match_.type); |
584 if (GetState() == SELECTED) { | 585 if (GetState() == SELECTED) { |
585 switch (icon) { | 586 switch (icon) { |
586 case IDR_OMNIBOX_CALCULATOR: | 587 case IDR_OMNIBOX_CALCULATOR: |
587 icon = IDR_OMNIBOX_CALCULATOR_SELECTED; | 588 icon = IDR_OMNIBOX_CALCULATOR_SELECTED; |
588 break; | 589 break; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
814 | 815 |
815 int OmniboxResultView::StartMargin() const { | 816 int OmniboxResultView::StartMargin() const { |
816 return ui::MaterialDesignController::IsModeMaterial() ? | 817 return ui::MaterialDesignController::IsModeMaterial() ? |
817 model_->start_margin() : 0; | 818 model_->start_margin() : 0; |
818 } | 819 } |
819 | 820 |
820 int OmniboxResultView::EndMargin() const { | 821 int OmniboxResultView::EndMargin() const { |
821 return ui::MaterialDesignController::IsModeMaterial() ? | 822 return ui::MaterialDesignController::IsModeMaterial() ? |
822 model_->end_margin() : 0; | 823 model_->end_margin() : 0; |
823 } | 824 } |
OLD | NEW |