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

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

Issue 250943008: Move enum MenuAnchorPosition to reduce deps on menu_item_view.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indent Created 6 years, 7 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/menu/submenu_view.cc ('k') | ui/views/controls/textfield/textfield.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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere); 298 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollHere);
299 menu->AppendSeparator(); 299 menu->AppendSeparator();
300 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart); 300 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart);
301 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollEnd); 301 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollEnd);
302 menu->AppendSeparator(); 302 menu->AppendSeparator();
303 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageUp); 303 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageUp);
304 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageDown); 304 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageDown);
305 menu->AppendSeparator(); 305 menu->AppendSeparator();
306 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev); 306 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev);
307 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); 307 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext);
308 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size()), 308 if (menu_runner_->RunMenuAt(
309 views::MenuItemView::TOPLEFT, source_type, MenuRunner::HAS_MNEMONICS | 309 GetWidget(),
310 views::MenuRunner::CONTEXT_MENU) == 310 NULL,
311 MenuRunner::MENU_DELETED) 311 gfx::Rect(p, gfx::Size()),
312 MENU_ANCHOR_TOPLEFT,
313 source_type,
314 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) ==
315 MenuRunner::MENU_DELETED) {
312 return; 316 return;
317 }
313 } 318 }
314 319
315 /////////////////////////////////////////////////////////////////////////////// 320 ///////////////////////////////////////////////////////////////////////////////
316 // BaseScrollBar, Menu::Delegate implementation: 321 // BaseScrollBar, Menu::Delegate implementation:
317 322
318 base::string16 BaseScrollBar::GetLabel(int id) const { 323 base::string16 BaseScrollBar::GetLabel(int id) const {
319 int ids_value = 0; 324 int ids_value = 0;
320 switch (id) { 325 switch (id) {
321 case ScrollBarContextMenuCommand_ScrollHere: 326 case ScrollBarContextMenuCommand_ScrollHere:
322 ids_value = IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE; 327 ids_value = IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 thumb_position = thumb_position - (thumb_->GetSize() / 2); 510 thumb_position = thumb_position - (thumb_->GetSize() / 2);
506 return (thumb_position * contents_size_) / GetTrackSize(); 511 return (thumb_position * contents_size_) / GetTrackSize();
507 } 512 }
508 513
509 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { 514 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) {
510 thumb_track_state_ = state; 515 thumb_track_state_ = state;
511 SchedulePaint(); 516 SchedulePaint();
512 } 517 }
513 518
514 } // namespace views 519 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/submenu_view.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698