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

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

Issue 189913014: Bug fix: Combobox: Focus on clicking mouse button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // The transparent button which holds a button state but is not rendered. 85 // The transparent button which holds a button state but is not rendered.
86 class TransparentButton : public CustomButton { 86 class TransparentButton : public CustomButton {
87 public: 87 public:
88 TransparentButton(ButtonListener* listener) 88 TransparentButton(ButtonListener* listener)
89 : CustomButton(listener) { 89 : CustomButton(listener) {
90 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs); 90 SetAnimationDuration(LabelButton::kHoverAnimationDurationMs);
91 } 91 }
92 virtual ~TransparentButton() {} 92 virtual ~TransparentButton() {}
93 93
94 virtual bool OnMousePressed(const ui::MouseEvent& mouse_event) OVERRIDE {
95 parent()->RequestFocus();
96 return true;
97 }
98
94 double GetAnimationValue() const { 99 double GetAnimationValue() const {
95 return hover_animation_->GetCurrentValue(); 100 return hover_animation_->GetCurrentValue();
96 } 101 }
97 102
98 private: 103 private:
99 DISALLOW_COPY_AND_ASSIGN(TransparentButton); 104 DISALLOW_COPY_AND_ASSIGN(TransparentButton);
100 }; 105 };
101 106
102 // Returns the next or previous valid index (depending on |increment|'s value). 107 // Returns the next or previous valid index (depending on |increment|'s value).
103 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent 108 // Skips separator or disabled indices. Returns -1 if there is no valid adjacent
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 case STYLE_NORMAL: 822 case STYLE_NORMAL:
818 return kDisclosureArrowRightPadding; 823 return kDisclosureArrowRightPadding;
819 case STYLE_ACTION: 824 case STYLE_ACTION:
820 return kDisclosureArrowButtonRightPadding; 825 return kDisclosureArrowButtonRightPadding;
821 } 826 }
822 NOTREACHED(); 827 NOTREACHED();
823 return 0; 828 return 0;
824 } 829 }
825 830
826 } // namespace views 831 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698