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

Side by Side Diff: views/controls/scrollbar/base_scroll_bar_button.cc

Issue 7767002: Revert 98434 - Adding a Views scrollbar implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/controls/scrollbar/base_scroll_bar_button.h"
6
7 namespace views {
8
9 BaseScrollBarButton::BaseScrollBarButton(ButtonListener* listener)
10 : CustomButton(listener),
11 ALLOW_THIS_IN_INITIALIZER_LIST(repeater_(
12 NewCallback<BaseScrollBarButton>(this,
13 &BaseScrollBarButton::RepeaterNotifyClick))) {
14 }
15
16 BaseScrollBarButton::~BaseScrollBarButton() {
17 }
18
19 bool BaseScrollBarButton::OnMousePressed(const MouseEvent& event) {
20 Button::NotifyClick(event);
21 repeater_.Start();
22 return true;
23 }
24
25 void BaseScrollBarButton::OnMouseReleased(const MouseEvent& event) {
26 OnMouseCaptureLost();
27 }
28
29 void BaseScrollBarButton::OnMouseCaptureLost() {
30 repeater_.Stop();
31 }
32
33 void BaseScrollBarButton::RepeaterNotifyClick() {
34 #if defined(OS_WIN)
35 DWORD pos = GetMessagePos();
36 POINTS points = MAKEPOINTS(pos);
37 gfx::Point cursor_point(points.x, points.y);
38 #elif defined(OS_LINUX)
39 gfx::Point cursor_point = gfx::Screen::GetCursorScreenPoint();
40 #endif
41 views::MouseEvent event(ui::ET_MOUSE_RELEASED,
42 cursor_point.x(), cursor_point.y(),
43 ui::EF_LEFT_BUTTON_DOWN);
44 Button::NotifyClick(event);
45 }
46
47 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/scrollbar/base_scroll_bar_button.h ('k') | views/controls/scrollbar/base_scroll_bar_thumb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698