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

Side by Side Diff: ui/views/style/platform_style_mac.mm

Issue 2228833002: MacViews: Fix behavior of move and select commands when selection direction changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_text_commands
Patch Set: Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/style/platform_style.h" 5 #include "ui/views/style/platform_style.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/paint_vector_icon.h" 9 #include "ui/gfx/paint_vector_icon.h"
10 #include "ui/gfx/vector_icons.h" 10 #include "ui/gfx/vector_icons.h"
(...skipping 10 matching lines...) Expand all
21 const int PlatformStyle::kComboboxNormalArrowPadding = 0; 21 const int PlatformStyle::kComboboxNormalArrowPadding = 0;
22 const int PlatformStyle::kMinLabelButtonWidth = 32; 22 const int PlatformStyle::kMinLabelButtonWidth = 32;
23 const int PlatformStyle::kMinLabelButtonHeight = 30; 23 const int PlatformStyle::kMinLabelButtonHeight = 30;
24 const bool PlatformStyle::kDefaultLabelButtonHasBoldFont = false; 24 const bool PlatformStyle::kDefaultLabelButtonHasBoldFont = false;
25 const bool PlatformStyle::kDialogDefaultButtonCanBeCancel = false; 25 const bool PlatformStyle::kDialogDefaultButtonCanBeCancel = false;
26 const bool PlatformStyle::kTextfieldDragVerticallyDragsToEnd = true; 26 const bool PlatformStyle::kTextfieldDragVerticallyDragsToEnd = true;
27 27
28 const CustomButton::NotifyAction PlatformStyle::kMenuNotifyActivationAction = 28 const CustomButton::NotifyAction PlatformStyle::kMenuNotifyActivationAction =
29 CustomButton::NOTIFY_ON_PRESS; 29 CustomButton::NOTIFY_ON_PRESS;
30 30
31 const gfx::SelectionReversedBehavior PlatformStyle::kWordSelectionBehavior =
32 gfx::SELECTION_CARET;
33 const gfx::SelectionReversedBehavior PlatformStyle::kLineSelectionBehavior =
34 gfx::SELECTION_EXTEND;
35
31 // static 36 // static
32 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled, 37 gfx::ImageSkia PlatformStyle::CreateComboboxArrow(bool is_enabled,
33 Combobox::Style style) { 38 Combobox::Style style) {
34 // TODO(ellyjones): IDR_MENU_DROPARROW is a cross-platform image that doesn't 39 // TODO(ellyjones): IDR_MENU_DROPARROW is a cross-platform image that doesn't
35 // look right on Mac. See https://crbug.com/384071. 40 // look right on Mac. See https://crbug.com/384071.
36 if (style == Combobox::STYLE_ACTION) { 41 if (style == Combobox::STYLE_ACTION) {
37 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 42 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
38 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); 43 return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW);
39 } 44 }
40 const int kComboboxArrowWidth = 24; 45 const int kComboboxArrowWidth = 24;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void PlatformStyle::ApplyLabelButtonTextStyle( 92 void PlatformStyle::ApplyLabelButtonTextStyle(
88 views::Label* label, 93 views::Label* label,
89 ButtonColorByState* color_by_state) { 94 ButtonColorByState* color_by_state) {
90 const ui::NativeTheme* theme = label->GetNativeTheme(); 95 const ui::NativeTheme* theme = label->GetNativeTheme();
91 ButtonColorByState& colors = *color_by_state; 96 ButtonColorByState& colors = *color_by_state;
92 colors[Button::STATE_PRESSED] = 97 colors[Button::STATE_PRESSED] =
93 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor); 98 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHighlightColor);
94 } 99 }
95 100
96 } // namespace views 101 } // namespace views
OLDNEW
« ui/views/controls/textfield/textfield.cc ('K') | « ui/views/style/platform_style.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698