Chromium Code Reviews| 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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 715 } | 715 } |
| 716 | 716 |
| 717 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { | 717 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { |
| 718 Layout(); | 718 Layout(); |
| 719 SchedulePaint(); | 719 SchedulePaint(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 int OmniboxResultView::GetAnswerLineHeight() const { | 722 int OmniboxResultView::GetAnswerLineHeight() const { |
| 723 // GetTextStyle(1) is the largest font used and so defines the boundary that | 723 // GetTextStyle(1) is the largest font used and so defines the boundary that |
| 724 // all the other answer styles fit within. | 724 // all the other answer styles fit within. |
| 725 return ui::ResourceBundle::GetSharedInstance() | 725 int font_height = |
| 726 ui::ResourceBundle::GetSharedInstance() | |
| 726 .GetFontList(GetTextStyle(1).font) | 727 .GetFontList(GetTextStyle(1).font) |
| 727 .GetHeight(); | 728 .GetHeight(); |
| 729 if (!ui::MaterialDesignController::IsModeMaterial()) | |
| 730 return font_height; | |
| 731 | |
| 732 // Answer lines should be at least as tall as content lines in | |
| 733 // material design. | |
| 734 return std::max(font_height, GetContentLineHeight()); | |
|
Peter Kasting
2015/10/13 19:21:17
Where in the specs is this requirement? I don't u
| |
| 728 } | 735 } |
| 729 | 736 |
| 730 int OmniboxResultView::GetContentLineHeight() const { | 737 int OmniboxResultView::GetContentLineHeight() const { |
| 731 return std::max( | 738 return std::max( |
| 732 default_icon_size_ + GetLayoutInsets(OMNIBOX_DROPDOWN_ICON).height(), | 739 default_icon_size_ + GetLayoutInsets(OMNIBOX_DROPDOWN_ICON).height(), |
| 733 GetTextHeight() + GetLayoutInsets(OMNIBOX_DROPDOWN_TEXT).height()); | 740 GetTextHeight() + GetLayoutInsets(OMNIBOX_DROPDOWN_TEXT).height()); |
| 734 } | 741 } |
| 735 | 742 |
| 736 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateAnswerLine( | 743 scoped_ptr<gfx::RenderText> OmniboxResultView::CreateAnswerLine( |
| 737 const SuggestionAnswer::ImageLine& line, | 744 const SuggestionAnswer::ImageLine& line, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 | 810 |
| 804 int OmniboxResultView::StartMargin() const { | 811 int OmniboxResultView::StartMargin() const { |
| 805 return ui::MaterialDesignController::IsModeMaterial() ? | 812 return ui::MaterialDesignController::IsModeMaterial() ? |
| 806 model_->start_margin() : 0; | 813 model_->start_margin() : 0; |
| 807 } | 814 } |
| 808 | 815 |
| 809 int OmniboxResultView::EndMargin() const { | 816 int OmniboxResultView::EndMargin() const { |
| 810 return ui::MaterialDesignController::IsModeMaterial() ? | 817 return ui::MaterialDesignController::IsModeMaterial() ? |
| 811 model_->end_margin() : 0; | 818 model_->end_margin() : 0; |
| 812 } | 819 } |
| OLD | NEW |