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

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: Rebase to ToT 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,
36 GetNativeTheme()->GetSystemColor(
36 ui::NativeTheme::kColorId_UnfocusedBorderColor))); 37 ui::NativeTheme::kColorId_UnfocusedBorderColor)));
37 } 38 }
38 39
39 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder); 40 DISALLOW_COPY_AND_ASSIGN(ScrollViewWithBorder);
40 }; 41 };
41 42
42 // Returns the position for the view so that it isn't scrolled off the visible 43 // Returns the position for the view so that it isn't scrolled off the visible
43 // region. 44 // region.
44 int CheckScrollBounds(int viewport_size, int content_size, int current_pos) { 45 int CheckScrollBounds(int viewport_size, int content_size, int current_pos) {
45 int max = std::max(content_size - viewport_size, 0); 46 int max = std::max(content_size - viewport_size, 0);
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 588
588 VariableRowHeightScrollHelper::RowInfo 589 VariableRowHeightScrollHelper::RowInfo
589 FixedRowHeightScrollHelper::GetRowInfo(int y) { 590 FixedRowHeightScrollHelper::GetRowInfo(int y) {
590 if (y < top_margin_) 591 if (y < top_margin_)
591 return RowInfo(0, top_margin_); 592 return RowInfo(0, top_margin_);
592 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_, 593 return RowInfo((y - top_margin_) / row_height_ * row_height_ + top_margin_,
593 row_height_); 594 row_height_);
594 } 595 }
595 596
596 } // namespace views 597 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_scroll_view_container.cc ('k') | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698