| 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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 // Pre-MD, normal icons are 19 px wide, while extension icons are 16 px wide. | 647 // Pre-MD, normal icons are 19 px wide, while extension icons are 16 px wide. |
| 648 // The code in IconLabelBubbleView::Layout() positions these icons in the | 648 // The code in IconLabelBubbleView::Layout() positions these icons in the |
| 649 // omnibox using ICON_LABEL_VIEW_TRAILING_PADDING, so we use that here as well | 649 // omnibox using ICON_LABEL_VIEW_TRAILING_PADDING, so we use that here as well |
| 650 // so the icons will line up. | 650 // so the icons will line up. |
| 651 // | 651 // |
| 652 // Technically we don't need the IsModeMaterial() check here, but it will make | 652 // Technically we don't need the IsModeMaterial() check here, but it will make |
| 653 // it easier to see that all this code is dead once we switch to MD. | 653 // it easier to see that all this code is dead once we switch to MD. |
| 654 int icon_x = start_x; | 654 int icon_x = start_x; |
| 655 if (!ui::MaterialDesignController::IsModeMaterial() && | 655 if (!ui::MaterialDesignController::IsModeMaterial() && |
| 656 (icon.width() != default_icon_size_)) | 656 (icon.width() != default_icon_size_)) |
| 657 icon_x += GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING); | 657 icon_x += IconLabelBubbleView::kTrailingPaddingPreMD; |
| 658 icon_bounds_.SetRect(icon_x, (GetContentLineHeight() - icon.height()) / 2, | 658 icon_bounds_.SetRect(icon_x, (GetContentLineHeight() - icon.height()) / 2, |
| 659 icon.width(), icon.height()); | 659 icon.width(), icon.height()); |
| 660 | 660 |
| 661 const int text_x = start_x + default_icon_size_ + horizontal_padding; | 661 const int text_x = start_x + default_icon_size_ + horizontal_padding; |
| 662 int text_width = end_x - text_x; | 662 int text_width = end_x - text_x; |
| 663 | 663 |
| 664 if (match_.associated_keyword.get()) { | 664 if (match_.associated_keyword.get()) { |
| 665 const int max_kw_x = end_x - keyword_icon_->width(); | 665 const int max_kw_x = end_x - keyword_icon_->width(); |
| 666 const int kw_x = animation_->CurrentValueBetween(max_kw_x, start_x); | 666 const int kw_x = animation_->CurrentValueBetween(max_kw_x, start_x); |
| 667 const int kw_text_x = kw_x + keyword_icon_->width() + horizontal_padding; | 667 const int kw_text_x = kw_x + keyword_icon_->width() + horizontal_padding; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 | 832 |
| 833 int OmniboxResultView::StartMargin() const { | 833 int OmniboxResultView::StartMargin() const { |
| 834 return ui::MaterialDesignController::IsModeMaterial() ? | 834 return ui::MaterialDesignController::IsModeMaterial() ? |
| 835 model_->start_margin() : 0; | 835 model_->start_margin() : 0; |
| 836 } | 836 } |
| 837 | 837 |
| 838 int OmniboxResultView::EndMargin() const { | 838 int OmniboxResultView::EndMargin() const { |
| 839 return ui::MaterialDesignController::IsModeMaterial() ? | 839 return ui::MaterialDesignController::IsModeMaterial() ? |
| 840 model_->end_margin() : 0; | 840 model_->end_margin() : 0; |
| 841 } | 841 } |
| OLD | NEW |