Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dont move declaration randomly Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); 94 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs);
95 } 95 }
96 ~TransparentButton() override {} 96 ~TransparentButton() override {}
97 97
98 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { 98 bool OnMousePressed(const ui::MouseEvent& mouse_event) override {
99 parent()->RequestFocus(); 99 parent()->RequestFocus();
100 return true; 100 return true;
101 } 101 }
102 102
103 double GetAnimationValue() const { 103 double GetAnimationValue() const {
104 return hover_animation_->GetCurrentValue(); 104 return hover_animation().GetCurrentValue();
105 } 105 }
106 106
107 private: 107 private:
108 DISALLOW_COPY_AND_ASSIGN(TransparentButton); 108 DISALLOW_COPY_AND_ASSIGN(TransparentButton);
109 }; 109 };
110 110
111 // Returns the next or previous valid index (depending on |increment|'s value). 111 // Returns the next or previous valid index (depending on |increment|'s value).
112 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent 112 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent
113 // index. 113 // index.
114 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { 114 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) {
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 return gfx::Size(width, font_list.GetHeight()); 926 return gfx::Size(width, font_list.GetHeight());
927 } 927 }
928 928
929 PrefixSelector* Combobox::GetPrefixSelector() { 929 PrefixSelector* Combobox::GetPrefixSelector() {
930 if (!selector_) 930 if (!selector_)
931 selector_.reset(new PrefixSelector(this)); 931 selector_.reset(new PrefixSelector(this));
932 return selector_.get(); 932 return selector_.get();
933 } 933 }
934 934
935 } // namespace views 935 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/controls/scrollbar/native_scroll_bar_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698