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

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

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 years, 7 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/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 // static 37 // static
38 int NativeScrollBar::GetVerticalScrollBarWidth( 38 int NativeScrollBar::GetVerticalScrollBarWidth(
39 const ui::NativeTheme* theme) { 39 const ui::NativeTheme* theme) {
40 return NativeScrollBarWrapper::GetVerticalScrollBarWidth(theme); 40 return NativeScrollBarWrapper::GetVerticalScrollBarWidth(theme);
41 } 41 }
42 42
43 //////////////////////////////////////////////////////////////////////////////// 43 ////////////////////////////////////////////////////////////////////////////////
44 // NativeScrollBar, View overrides: 44 // NativeScrollBar, View overrides:
45 gfx::Size NativeScrollBar::GetPreferredSize() { 45 gfx::Size NativeScrollBar::GetPreferredSize() const {
46 if (native_wrapper_) 46 if (native_wrapper_)
47 return native_wrapper_->GetView()->GetPreferredSize(); 47 return native_wrapper_->GetView()->GetPreferredSize();
48 return gfx::Size(); 48 return gfx::Size();
49 } 49 }
50 50
51 void NativeScrollBar::Layout() { 51 void NativeScrollBar::Layout() {
52 if (native_wrapper_) { 52 if (native_wrapper_) {
53 native_wrapper_->GetView()->SetBounds(0, 0, width(), height()); 53 native_wrapper_->GetView()->SetBounds(0, 0, width(), height());
54 native_wrapper_->GetView()->Layout(); 54 native_wrapper_->GetView()->Layout();
55 } 55 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 int NativeScrollBar::GetPosition() const { 107 int NativeScrollBar::GetPosition() const {
108 if (!native_wrapper_) 108 if (!native_wrapper_)
109 return 0; 109 return 0;
110 return native_wrapper_->GetPosition(); 110 return native_wrapper_->GetPosition();
111 } 111 }
112 112
113 } // namespace views 113 } // namespace views
114 114
OLDNEW
« no previous file with comments | « ui/views/controls/scrollbar/native_scroll_bar.h ('k') | ui/views/controls/scrollbar/native_scroll_bar_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698