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

Side by Side Diff: ui/views/controls/scrollbar/base_scroll_bar.cc

Issue 10795013: Rename bounds accessors to be intuitive and consistent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | « ui/views/controls/button/menu_button.cc ('k') | ui/views/examples/widget_example.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) 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/scrollbar/base_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/base_scroll_bar.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 ScrollBarContextMenuCommand_ScrollStart, 212 ScrollBarContextMenuCommand_ScrollStart,
213 ScrollBarContextMenuCommand_ScrollEnd, 213 ScrollBarContextMenuCommand_ScrollEnd,
214 ScrollBarContextMenuCommand_ScrollPageUp, 214 ScrollBarContextMenuCommand_ScrollPageUp,
215 ScrollBarContextMenuCommand_ScrollPageDown, 215 ScrollBarContextMenuCommand_ScrollPageDown,
216 ScrollBarContextMenuCommand_ScrollPrev, 216 ScrollBarContextMenuCommand_ScrollPrev,
217 ScrollBarContextMenuCommand_ScrollNext 217 ScrollBarContextMenuCommand_ScrollNext
218 }; 218 };
219 219
220 void BaseScrollBar::ShowContextMenuForView(View* source, const gfx::Point& p) { 220 void BaseScrollBar::ShowContextMenuForView(View* source, const gfx::Point& p) {
221 Widget* widget = GetWidget(); 221 Widget* widget = GetWidget();
222 gfx::Rect widget_bounds = widget->GetWindowScreenBounds(); 222 gfx::Rect widget_bounds = widget->GetWindowBoundsInScreen();
223 gfx::Point temp_pt(p.x() - widget_bounds.x(), p.y() - widget_bounds.y()); 223 gfx::Point temp_pt(p.x() - widget_bounds.x(), p.y() - widget_bounds.y());
224 View::ConvertPointFromWidget(this, &temp_pt); 224 View::ConvertPointFromWidget(this, &temp_pt);
225 context_menu_mouse_position_ = IsHorizontal() ? temp_pt.x() : temp_pt.y(); 225 context_menu_mouse_position_ = IsHorizontal() ? temp_pt.x() : temp_pt.y();
226 226
227 views::MenuItemView* menu = new views::MenuItemView(this); 227 views::MenuItemView* menu = new views::MenuItemView(this);
228 // MenuRunner takes ownership of |menu|. 228 // MenuRunner takes ownership of |menu|.
229 menu_runner_.reset(new MenuRunner(menu)); 229 menu_runner_.reset(new MenuRunner(menu));
230 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere); 230 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere);
231 menu->AppendSeparator(); 231 menu->AppendSeparator();
232 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart); 232 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 thumb_position = thumb_position - (thumb_->GetSize() / 2); 422 thumb_position = thumb_position - (thumb_->GetSize() / 2);
423 return (thumb_position * contents_size_) / GetTrackSize(); 423 return (thumb_position * contents_size_) / GetTrackSize();
424 } 424 }
425 425
426 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { 426 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) {
427 thumb_track_state_ = state; 427 thumb_track_state_ = state;
428 SchedulePaint(); 428 SchedulePaint();
429 } 429 }
430 430
431 } // namespace views 431 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/examples/widget_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698