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

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: revert a change Created 5 years 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/accessibility/ax_view_state.h" 8 #include "ui/accessibility/ax_view_state.h"
9 #include "ui/base/ime/input_method.h" 9 #include "ui/base/ime/input_method.h"
10 #include "ui/base/models/combobox_model.h" 10 #include "ui/base/models/combobox_model.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); 88 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs);
89 } 89 }
90 ~TransparentButton() override {} 90 ~TransparentButton() override {}
91 91
92 bool OnMousePressed(const ui::MouseEvent& mouse_event) override { 92 bool OnMousePressed(const ui::MouseEvent& mouse_event) override {
93 parent()->RequestFocus(); 93 parent()->RequestFocus();
94 return true; 94 return true;
95 } 95 }
96 96
97 double GetAnimationValue() const { 97 double GetAnimationValue() const {
98 return hover_animation_->GetCurrentValue(); 98 return hover_animation().GetCurrentValue();
99 } 99 }
100 100
101 private: 101 private:
102 DISALLOW_COPY_AND_ASSIGN(TransparentButton); 102 DISALLOW_COPY_AND_ASSIGN(TransparentButton);
103 }; 103 };
104 104
105 // Returns the next or previous valid index (depending on |increment|'s value). 105 // Returns the next or previous valid index (depending on |increment|'s value).
106 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent 106 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent
107 // index. 107 // index.
108 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) { 108 int GetAdjacentIndex(ui::ComboboxModel* model, int increment, int index) {
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 return gfx::Size(width, font_list.GetHeight()); 920 return gfx::Size(width, font_list.GetHeight());
921 } 921 }
922 922
923 PrefixSelector* Combobox::GetPrefixSelector() { 923 PrefixSelector* Combobox::GetPrefixSelector() {
924 if (!selector_) 924 if (!selector_)
925 selector_.reset(new PrefixSelector(this)); 925 selector_.reset(new PrefixSelector(this));
926 return selector_.get(); 926 return selector_.get();
927 } 927 }
928 928
929 } // namespace views 929 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698