| 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 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <atlbase.h> // NOLINT | 9 #include <atlbase.h> // NOLINT |
| 10 #include <atlwin.h> // NOLINT | 10 #include <atlwin.h> // NOLINT |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 model_index_(model_index), | 191 model_index_(model_index), |
| 192 location_bar_view_(location_bar_view), | 192 location_bar_view_(location_bar_view), |
| 193 font_list_(font_list), | 193 font_list_(font_list), |
| 194 font_height_(std::max( | 194 font_height_(std::max( |
| 195 font_list.GetHeight(), | 195 font_list.GetHeight(), |
| 196 font_list.DeriveWithWeight(gfx::Font::Weight::BOLD).GetHeight())), | 196 font_list.DeriveWithWeight(gfx::Font::Weight::BOLD).GetHeight())), |
| 197 mirroring_context_(new MirroringContext()), | 197 mirroring_context_(new MirroringContext()), |
| 198 keyword_icon_(new views::ImageView()), | 198 keyword_icon_(new views::ImageView()), |
| 199 animation_(new gfx::SlideAnimation(this)) { | 199 animation_(new gfx::SlideAnimation(this)) { |
| 200 CHECK_GE(model_index, 0); | 200 CHECK_GE(model_index, 0); |
| 201 if (default_icon_size_ == 0) { | 201 if (default_icon_size_ == 0) |
| 202 default_icon_size_ = | 202 default_icon_size_ = location_bar_view_->GetLocationIconWidth(); |
| 203 location_bar_view_->GetThemeProvider()->GetImageSkiaNamed( | |
| 204 AutocompleteMatch::TypeToIcon( | |
| 205 AutocompleteMatchType::URL_WHAT_YOU_TYPED))->width(); | |
| 206 } | |
| 207 keyword_icon_->set_owned_by_client(); | 203 keyword_icon_->set_owned_by_client(); |
| 208 keyword_icon_->EnableCanvasFlippingForRTLUI(true); | 204 keyword_icon_->EnableCanvasFlippingForRTLUI(true); |
| 209 keyword_icon_->SetImage(GetKeywordIcon()); | 205 keyword_icon_->SetImage(GetKeywordIcon()); |
| 210 keyword_icon_->SizeToPreferredSize(); | 206 keyword_icon_->SizeToPreferredSize(); |
| 211 } | 207 } |
| 212 | 208 |
| 213 OmniboxResultView::~OmniboxResultView() { | 209 OmniboxResultView::~OmniboxResultView() { |
| 214 } | 210 } |
| 215 | 211 |
| 216 SkColor OmniboxResultView::GetColor( | 212 SkColor OmniboxResultView::GetColor( |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 | 828 |
| 833 int OmniboxResultView::StartMargin() const { | 829 int OmniboxResultView::StartMargin() const { |
| 834 return ui::MaterialDesignController::IsModeMaterial() ? | 830 return ui::MaterialDesignController::IsModeMaterial() ? |
| 835 model_->start_margin() : 0; | 831 model_->start_margin() : 0; |
| 836 } | 832 } |
| 837 | 833 |
| 838 int OmniboxResultView::EndMargin() const { | 834 int OmniboxResultView::EndMargin() const { |
| 839 return ui::MaterialDesignController::IsModeMaterial() ? | 835 return ui::MaterialDesignController::IsModeMaterial() ? |
| 840 model_->end_margin() : 0; | 836 model_->end_margin() : 0; |
| 841 } | 837 } |
| OLD | NEW |