| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/touchui/touch_editing_menu.h" | 5 #include "ui/views/touchui/touch_editing_menu.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const int kMenuCommands[] = {IDS_APP_CUT, | 24 const int kMenuCommands[] = {IDS_APP_CUT, |
| 25 IDS_APP_COPY, | 25 IDS_APP_COPY, |
| 26 IDS_APP_PASTE}; | 26 IDS_APP_PASTE}; |
| 27 const int kSpacingBetweenButtons = 2; | 27 const int kSpacingBetweenButtons = 2; |
| 28 const int kButtonSeparatorColor = SkColorSetARGB(13, 0, 0, 0); | 28 const int kButtonSeparatorColor = SkColorSetARGB(13, 0, 0, 0); |
| 29 const int kMenuButtonHeight = 38; | 29 const int kMenuButtonHeight = 38; |
| 30 const int kMenuButtonWidth = 63; | 30 const int kMenuButtonWidth = 63; |
| 31 const int kMenuMargin = 1; | 31 const int kMenuMargin = 1; |
| 32 const SkColor kMenuButtonColorNormal = SkColorSetARGB(102, 255, 255, 255); | |
| 33 const SkColor kMenuButtonColorHover = SkColorSetARGB(13, 0, 0, 0); | |
| 34 | 32 |
| 35 const char* kEllipsesButtonText = "..."; | 33 const char* kEllipsesButtonText = "..."; |
| 36 const int kEllipsesButtonTag = -1; | 34 const int kEllipsesButtonTag = -1; |
| 37 } // namespace | 35 } // namespace |
| 38 | 36 |
| 39 namespace views { | 37 namespace views { |
| 40 | 38 |
| 41 class TouchEditingMenuButtonBorder : public LabelButtonBorder { | 39 class TouchEditingMenuButtonBorder : public LabelButtonBorder { |
| 42 public: | 40 public: |
| 43 TouchEditingMenuButtonBorder(Button::ButtonStyle style, | 41 TouchEditingMenuButtonBorder(Button::ButtonStyle style, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 int v_border = (kMenuButtonHeight - font.GetHeight()) / 2; | 157 int v_border = (kMenuButtonHeight - font.GetHeight()) / 2; |
| 160 int h_border = (kMenuButtonWidth - font.GetStringWidth(label)) / 2; | 158 int h_border = (kMenuButtonWidth - font.GetStringWidth(label)) / 2; |
| 161 button->set_border(new TouchEditingMenuButtonBorder(button->style(), | 159 button->set_border(new TouchEditingMenuButtonBorder(button->style(), |
| 162 gfx::Insets(v_border, h_border, v_border, h_border))); | 160 gfx::Insets(v_border, h_border, v_border, h_border))); |
| 163 button->SetFont(font); | 161 button->SetFont(font); |
| 164 button->set_tag(tag); | 162 button->set_tag(tag); |
| 165 return button; | 163 return button; |
| 166 } | 164 } |
| 167 | 165 |
| 168 } // namespace views | 166 } // namespace views |
| OLD | NEW |