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

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

Issue 10824295: Rid the world of the last of views::Event types: TouchEvent, GestureEvent, MouseWheelEvent, ScrollE… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
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/native_scroll_bar.h" 5 #include "ui/views/controls/scrollbar/native_scroll_bar.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return kViewClassName; 69 return kViewClassName;
70 } 70 }
71 71
72 // Overridden from View for keyboard UI. 72 // Overridden from View for keyboard UI.
73 bool NativeScrollBar::OnKeyPressed(const ui::KeyEvent& event) { 73 bool NativeScrollBar::OnKeyPressed(const ui::KeyEvent& event) {
74 if (!native_wrapper_) 74 if (!native_wrapper_)
75 return false; 75 return false;
76 return native_wrapper_->GetView()->OnKeyPressed(event); 76 return native_wrapper_->GetView()->OnKeyPressed(event);
77 } 77 }
78 78
79 ui::GestureStatus NativeScrollBar::OnGestureEvent(const GestureEvent& event) { 79 ui::GestureStatus NativeScrollBar::OnGestureEvent(
80 const ui::GestureEvent& event) {
80 if (!native_wrapper_) 81 if (!native_wrapper_)
81 return ui::GESTURE_STATUS_UNKNOWN; 82 return ui::GESTURE_STATUS_UNKNOWN;
82 return native_wrapper_->GetView()->OnGestureEvent(event); 83 return native_wrapper_->GetView()->OnGestureEvent(event);
83 } 84 }
84 85
85 bool NativeScrollBar::OnMouseWheel(const MouseWheelEvent& event) { 86 bool NativeScrollBar::OnMouseWheel(const ui::MouseWheelEvent& event) {
86 if (!native_wrapper_) 87 if (!native_wrapper_)
87 return false; 88 return false;
88 return native_wrapper_->GetView()->OnMouseWheel(event); 89 return native_wrapper_->GetView()->OnMouseWheel(event);
89 } 90 }
90 91
91 //////////////////////////////////////////////////////////////////////////////// 92 ////////////////////////////////////////////////////////////////////////////////
92 // NativeScrollBar, ScrollBar overrides: 93 // NativeScrollBar, ScrollBar overrides:
93 void NativeScrollBar::Update(int viewport_size, 94 void NativeScrollBar::Update(int viewport_size,
94 int content_size, 95 int content_size,
95 int current_pos) { 96 int current_pos) {
96 ScrollBar::Update(viewport_size, content_size, current_pos); 97 ScrollBar::Update(viewport_size, content_size, current_pos);
97 98
98 if (native_wrapper_) 99 if (native_wrapper_)
99 native_wrapper_->Update(viewport_size, content_size, current_pos); 100 native_wrapper_->Update(viewport_size, content_size, current_pos);
100 } 101 }
101 102
102 int NativeScrollBar::GetLayoutSize() const { 103 int NativeScrollBar::GetLayoutSize() const {
103 return IsHorizontal() ? 104 return IsHorizontal() ?
104 GetHorizontalScrollBarHeight() : GetVerticalScrollBarWidth(); 105 GetHorizontalScrollBarHeight() : GetVerticalScrollBarWidth();
105 } 106 }
106 107
107 int NativeScrollBar::GetPosition() const { 108 int NativeScrollBar::GetPosition() const {
108 if (!native_wrapper_) 109 if (!native_wrapper_)
109 return 0; 110 return 0;
110 return native_wrapper_->GetPosition(); 111 return native_wrapper_->GetPosition();
111 } 112 }
112 113
113 } // namespace views 114 } // namespace views
114 115
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/native_scroll_bar.h ('k') | ui/views/controls/scrollbar/native_scroll_bar_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698