| OLD | NEW |
| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 menu->AppendSeparator(); | 259 menu->AppendSeparator(); |
| 260 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart); | 260 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollStart); |
| 261 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollEnd); | 261 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollEnd); |
| 262 menu->AppendSeparator(); | 262 menu->AppendSeparator(); |
| 263 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageUp); | 263 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageUp); |
| 264 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageDown); | 264 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPageDown); |
| 265 menu->AppendSeparator(); | 265 menu->AppendSeparator(); |
| 266 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev); | 266 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollPrev); |
| 267 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); | 267 menu->AppendDelegateMenuItem(ScrollBarContextMenuCommand_ScrollNext); |
| 268 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size()), | 268 if (menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(p, gfx::Size()), |
| 269 MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS) == | 269 MenuItemView::TOPLEFT, MenuRunner::HAS_MNEMONICS | |
| 270 views::MenuRunner::CONTEXT_MENU) == |
| 270 MenuRunner::MENU_DELETED) | 271 MenuRunner::MENU_DELETED) |
| 271 return; | 272 return; |
| 272 } | 273 } |
| 273 | 274 |
| 274 /////////////////////////////////////////////////////////////////////////////// | 275 /////////////////////////////////////////////////////////////////////////////// |
| 275 // BaseScrollBar, Menu::Delegate implementation: | 276 // BaseScrollBar, Menu::Delegate implementation: |
| 276 | 277 |
| 277 string16 BaseScrollBar::GetLabel(int id) const { | 278 string16 BaseScrollBar::GetLabel(int id) const { |
| 278 int ids_value = 0; | 279 int ids_value = 0; |
| 279 switch (id) { | 280 switch (id) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 thumb_position = thumb_position - (thumb_->GetSize() / 2); | 451 thumb_position = thumb_position - (thumb_->GetSize() / 2); |
| 451 return (thumb_position * contents_size_) / GetTrackSize(); | 452 return (thumb_position * contents_size_) / GetTrackSize(); |
| 452 } | 453 } |
| 453 | 454 |
| 454 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { | 455 void BaseScrollBar::SetThumbTrackState(CustomButton::ButtonState state) { |
| 455 thumb_track_state_ = state; | 456 thumb_track_state_ = state; |
| 456 SchedulePaint(); | 457 SchedulePaint(); |
| 457 } | 458 } |
| 458 | 459 |
| 459 } // namespace views | 460 } // namespace views |
| OLD | NEW |