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

Side by Side Diff: ui/views/controls/scroll_view.cc

Issue 10825254: Remove views::KeyEvent, replacing uses of it with ui::KeyEvent. (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
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | ui/views/controls/scrollbar/base_scroll_bar.h » ('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/scroll_view.h" 5 #include "ui/views/controls/scroll_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/event.h"
8 #include "ui/views/controls/scrollbar/native_scroll_bar.h" 9 #include "ui/views/controls/scrollbar/native_scroll_bar.h"
9 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
10 11
11 namespace views { 12 namespace views {
12 13
13 const char* const ScrollView::kViewClassName = "views/ScrollView"; 14 const char* const ScrollView::kViewClassName = "views/ScrollView";
14 15
15 // Viewport contains the contents View of the ScrollView. 16 // Viewport contains the contents View of the ScrollView.
16 class Viewport : public View { 17 class Viewport : public View {
17 public: 18 public:
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 amount = view->GetLineScrollIncrement(this, is_horizontal, is_positive); 380 amount = view->GetLineScrollIncrement(this, is_horizontal, is_positive);
380 if (amount > 0) 381 if (amount > 0)
381 return amount; 382 return amount;
382 } 383 }
383 // No view, or the view didn't return a valid amount. 384 // No view, or the view didn't return a valid amount.
384 if (is_page) 385 if (is_page)
385 return is_horizontal ? viewport_->width() : viewport_->height(); 386 return is_horizontal ? viewport_->width() : viewport_->height();
386 return is_horizontal ? viewport_->width() / 5 : viewport_->height() / 5; 387 return is_horizontal ? viewport_->width() / 5 : viewport_->height() / 5;
387 } 388 }
388 389
389 bool ScrollView::OnKeyPressed(const KeyEvent& event) { 390 bool ScrollView::OnKeyPressed(const ui::KeyEvent& event) {
390 bool processed = false; 391 bool processed = false;
391 392
392 // Give vertical scrollbar priority 393 // Give vertical scrollbar priority
393 if (vert_sb_->visible()) 394 if (vert_sb_->visible())
394 processed = vert_sb_->OnKeyPressed(event); 395 processed = vert_sb_->OnKeyPressed(event);
395 396
396 if (!processed && horiz_sb_->visible()) 397 if (!processed && horiz_sb_->visible())
397 processed = horiz_sb_->OnKeyPressed(event); 398 processed = horiz_sb_->OnKeyPressed(event);
398 399
399 return processed; 400 return processed;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 512
512 VariableRowHeightScrollHelper::RowInfo 513 VariableRowHeightScrollHelper::RowInfo
513 FixedRowHeightScrollHelper::GetRowInfo(int y) { 514 FixedRowHeightScrollHelper::GetRowInfo(int y) {
514 if (y < top_margin_) 515 if (y < top_margin_)
515 return RowInfo(0, top_margin_); 516 return RowInfo(0, top_margin_);
516 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, 517 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
517 row_height_); 518 row_height_);
518 } 519 }
519 520
520 } // namespace views 521 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/scroll_view.h ('k') | ui/views/controls/scrollbar/base_scroll_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698