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

Side by Side Diff: views/controls/button/menu_button.cc

Issue 6334152: Clean up RTL methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « views/animation/bounds_animator.cc ('k') | views/controls/button/text_button.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/button/menu_button.h" 5 #include "views/controls/button/menu_button.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/app_strings.h" 8 #include "grit/app_strings.h"
9 #include "grit/app_resources.h" 9 #include "grit/app_resources.h"
10 #include "ui/base/dragdrop/drag_drop_types.h" 10 #include "ui/base/dragdrop/drag_drop_types.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // We can not use the views' mirroring infrastructure for mirroring a 90 // We can not use the views' mirroring infrastructure for mirroring a
91 // MenuButton control (see TextButton::Paint() for a detailed explanation 91 // MenuButton control (see TextButton::Paint() for a detailed explanation
92 // regarding why we can not flip the canvas). Therefore, we need to 92 // regarding why we can not flip the canvas). Therefore, we need to
93 // manually mirror the position of the down arrow. 93 // manually mirror the position of the down arrow.
94 gfx::Rect arrow_bounds(width() - insets.right() - 94 gfx::Rect arrow_bounds(width() - insets.right() -
95 menu_marker_->width() - kMenuMarkerPaddingRight, 95 menu_marker_->width() - kMenuMarkerPaddingRight,
96 height() / 2 - menu_marker_->height() / 2, 96 height() / 2 - menu_marker_->height() / 2,
97 menu_marker_->width(), 97 menu_marker_->width(),
98 menu_marker_->height()); 98 menu_marker_->height());
99 arrow_bounds.set_x(MirroredLeftPointForRect(arrow_bounds)); 99 arrow_bounds.set_x(GetMirroredXForRect(arrow_bounds));
100 canvas->DrawBitmapInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y()); 100 canvas->DrawBitmapInt(*menu_marker_, arrow_bounds.x(), arrow_bounds.y());
101 } 101 }
102 } 102 }
103 103
104 //////////////////////////////////////////////////////////////////////////////// 104 ////////////////////////////////////////////////////////////////////////////////
105 // 105 //
106 // MenuButton - Events 106 // MenuButton - Events
107 // 107 //
108 //////////////////////////////////////////////////////////////////////////////// 108 ////////////////////////////////////////////////////////////////////////////////
109 109
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 AccessibilityTypes::State MenuButton::GetAccessibleState() { 267 AccessibilityTypes::State MenuButton::GetAccessibleState() {
268 return AccessibilityTypes::STATE_HASPOPUP; 268 return AccessibilityTypes::STATE_HASPOPUP;
269 } 269 }
270 270
271 std::string MenuButton::GetClassName() const { 271 std::string MenuButton::GetClassName() const {
272 return kViewClassName; 272 return kViewClassName;
273 } 273 }
274 274
275 } // namespace views 275 } // namespace views
OLDNEW
« no previous file with comments | « views/animation/bounds_animator.cc ('k') | views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698