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

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

Issue 2391393002: Harmony - Use FocusableBorder for comboboxes on Mac (Closed)
Patch Set: Created 4 years, 2 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (event.IsKeyEvent()) 761 if (event.IsKeyEvent())
762 source_type = ui::MENU_SOURCE_KEYBOARD; 762 source_type = ui::MENU_SOURCE_KEYBOARD;
763 else if (event.IsGestureEvent() || event.IsTouchEvent()) 763 else if (event.IsGestureEvent() || event.IsTouchEvent())
764 source_type = ui::MENU_SOURCE_TOUCH; 764 source_type = ui::MENU_SOURCE_TOUCH;
765 ShowDropDownMenu(source_type); 765 ShowDropDownMenu(source_type);
766 } 766 }
767 } 767 }
768 768
769 void Combobox::UpdateBorder() { 769 void Combobox::UpdateBorder() {
770 std::unique_ptr<FocusableBorder> border( 770 std::unique_ptr<FocusableBorder> border(
771 PlatformStyle::CreateComboboxBorder()); 771 UseMd() ? new FocusableBorder() : PlatformStyle::CreateComboboxBorder());
Elly Fong-Jones 2016/10/06 14:15:36 this won't build - FocusableBorder* and unique_ptr
Evan Stade 2016/10/06 15:51:08 good call, fixed. It also occurs to me we probabl
772 if (style_ == STYLE_ACTION) 772 if (style_ == STYLE_ACTION)
773 border->SetInsets(5, 10, 5, 10); 773 border->SetInsets(5, 10, 5, 10);
774 if (invalid_) 774 if (invalid_)
775 border->SetColor(gfx::kGoogleRed700); 775 border->SetColor(gfx::kGoogleRed700);
776 SetBorder(std::move(border)); 776 SetBorder(std::move(border));
777 } 777 }
778 778
779 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { 779 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const {
780 rect->set_x(GetMirroredXForRect(*rect)); 780 rect->set_x(GetMirroredXForRect(*rect));
781 } 781 }
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 const int kMdPaddingWidth = 8; 997 const int kMdPaddingWidth = 8;
998 int arrow_pad = UseMd() ? kMdPaddingWidth 998 int arrow_pad = UseMd() ? kMdPaddingWidth
999 : PlatformStyle::kComboboxNormalArrowPadding; 999 : PlatformStyle::kComboboxNormalArrowPadding;
1000 int padding = style_ == STYLE_NORMAL 1000 int padding = style_ == STYLE_NORMAL
1001 ? arrow_pad * 2 1001 ? arrow_pad * 2
1002 : kActionLeftPadding + kActionRightPadding; 1002 : kActionLeftPadding + kActionRightPadding;
1003 return ArrowSize().width() + padding; 1003 return ArrowSize().width() + padding;
1004 } 1004 }
1005 1005
1006 } // namespace views 1006 } // 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