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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further renaming Created 6 years, 11 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/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/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/native_theme/native_theme.h" 9 #include "ui/native_theme/native_theme.h"
10 #include "ui/views/border.h" 10 #include "ui/views/border.h"
(...skipping 13 matching lines...) Expand all
24 SetThemeSpecificState(); 24 SetThemeSpecificState();
25 } 25 }
26 26
27 // View overrides; 27 // View overrides;
28 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE { 28 virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE {
29 SetThemeSpecificState(); 29 SetThemeSpecificState();
30 } 30 }
31 31
32 private: 32 private:
33 void SetThemeSpecificState() { 33 void SetThemeSpecificState() {
34 set_border(Border::CreateSolidBorder( 34 SetBorder(Border::CreateSolidBorder(
35 1, GetNativeTheme()->GetSystemColor( 35 1, GetNativeTheme()->GetSystemColor(
36 ui::NativeTheme::kColorId_UnfocusedBorderColor))); 36 ui::NativeTheme::kColorId_UnfocusedBorderColor)));
37 } 37 }
38 38
39 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder); 39 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder);
40 }; 40 };
41 41
42 // Returns the position for the view so that it isn't scrolled off the visible 42 // Returns the position for the view so that it isn't scrolled off the visible
43 // region. 43 // region.
44 int CheckScrollBounds(int viewport_size, int content_size, int current_pos) { 44 int CheckScrollBounds(int viewport_size, int content_size, int current_pos) {
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 587
588 VariableRowHeightScrollHelper::RowInfo 588 VariableRowHeightScrollHelper::RowInfo
589 FixedRowHeightScrollHelper::GetRowInfo(int y) { 589 FixedRowHeightScrollHelper::GetRowInfo(int y) {
590 if (y < top_margin_) 590 if (y < top_margin_)
591 return RowInfo(0, top_margin_); 591 return RowInfo(0, top_margin_);
592 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, 592 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
593 row_height_); 593 row_height_);
594 } 594 }
595 595
596 } // namespace views 596 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698