| 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 #include "ui/views/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "ui/gfx/canvas.h" | 23 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/color_palette.h" | 24 #include "ui/gfx/color_palette.h" |
| 25 #include "ui/gfx/scoped_canvas.h" | 25 #include "ui/gfx/scoped_canvas.h" |
| 26 #include "ui/gfx/text_utils.h" | 26 #include "ui/gfx/text_utils.h" |
| 27 #include "ui/native_theme/common_theme.h" | 27 #include "ui/native_theme/common_theme.h" |
| 28 #include "ui/native_theme/native_theme.h" | 28 #include "ui/native_theme/native_theme.h" |
| 29 #include "ui/native_theme/native_theme_aura.h" | 29 #include "ui/native_theme/native_theme_aura.h" |
| 30 #include "ui/resources/grit/ui_resources.h" | 30 #include "ui/resources/grit/ui_resources.h" |
| 31 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" | 31 #include "ui/views/animation/flood_fill_ink_drop_ripple.h" |
| 32 #include "ui/views/animation/ink_drop_highlight.h" | 32 #include "ui/views/animation/ink_drop_highlight.h" |
| 33 #include "ui/views/animation/ink_drop_impl.h" |
| 33 #include "ui/views/background.h" | 34 #include "ui/views/background.h" |
| 34 #include "ui/views/controls/button/custom_button.h" | 35 #include "ui/views/controls/button/custom_button.h" |
| 35 #include "ui/views/controls/button/label_button.h" | 36 #include "ui/views/controls/button/label_button.h" |
| 36 #include "ui/views/controls/combobox/combobox_listener.h" | 37 #include "ui/views/controls/combobox/combobox_listener.h" |
| 37 #include "ui/views/controls/focus_ring.h" | 38 #include "ui/views/controls/focus_ring.h" |
| 38 #include "ui/views/controls/focusable_border.h" | 39 #include "ui/views/controls/focusable_border.h" |
| 39 #include "ui/views/controls/menu/menu_config.h" | 40 #include "ui/views/controls/menu/menu_config.h" |
| 40 #include "ui/views/controls/menu/menu_runner.h" | 41 #include "ui/views/controls/menu/menu_runner.h" |
| 41 #include "ui/views/controls/prefix_selector.h" | 42 #include "ui/views/controls/prefix_selector.h" |
| 42 #include "ui/views/controls/textfield/textfield.h" | 43 #include "ui/views/controls/textfield/textfield.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Overridden from InkDropHost: | 144 // Overridden from InkDropHost: |
| 144 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override { | 145 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override { |
| 145 return std::unique_ptr<views::InkDropRipple>( | 146 return std::unique_ptr<views::InkDropRipple>( |
| 146 new views::FloodFillInkDropRipple( | 147 new views::FloodFillInkDropRipple( |
| 147 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(), | 148 GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(), |
| 148 GetNativeTheme()->GetSystemColor( | 149 GetNativeTheme()->GetSystemColor( |
| 149 ui::NativeTheme::kColorId_LabelEnabledColor), | 150 ui::NativeTheme::kColorId_LabelEnabledColor), |
| 150 ink_drop_visible_opacity())); | 151 ink_drop_visible_opacity())); |
| 151 } | 152 } |
| 152 | 153 |
| 153 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override { | |
| 154 return nullptr; | |
| 155 } | |
| 156 | |
| 157 private: | 154 private: |
| 158 DISALLOW_COPY_AND_ASSIGN(TransparentButton); | 155 DISALLOW_COPY_AND_ASSIGN(TransparentButton); |
| 159 }; | 156 }; |
| 160 | 157 |
| 161 // Returns the next or previous valid index (depending on |increment|'s value). | 158 // Returns the next or previous valid index (depending on |increment|'s value). |
| 162 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent | 159 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent |
| 163 // index. | 160 // index. |
| 164 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { | 161 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { |
| 165 DCHECK(increment == -1 || increment == 1); | 162 DCHECK(increment == -1 || increment == 1); |
| 166 | 163 |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 const int kMdPaddingWidth = 8; | 991 const int kMdPaddingWidth = 8; |
| 995 int arrow_pad = UseMd() ? kMdPaddingWidth | 992 int arrow_pad = UseMd() ? kMdPaddingWidth |
| 996 : PlatformStyle::kComboboxNormalArrowPadding; | 993 : PlatformStyle::kComboboxNormalArrowPadding; |
| 997 int padding = style_ == STYLE_NORMAL | 994 int padding = style_ == STYLE_NORMAL |
| 998 ? arrow_pad * 2 | 995 ? arrow_pad * 2 |
| 999 : kActionLeftPadding + kActionRightPadding; | 996 : kActionLeftPadding + kActionRightPadding; |
| 1000 return ArrowSize().width() + padding; | 997 return ArrowSize().width() + padding; |
| 1001 } | 998 } |
| 1002 | 999 |
| 1003 } // namespace views | 1000 } // namespace views |
| OLD | NEW |