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

Side by Side Diff: views/controls/scrollbar/native_scroll_bar_win.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/scrollbar/native_scroll_bar_win.h" 5 #include "views/controls/scrollbar/native_scroll_bar_win.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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // cases including when the container is no longer connected to a 209 // cases including when the container is no longer connected to a
210 // widget tree. 210 // widget tree.
211 DestroyWindow(sb_container_->hwnd()); 211 DestroyWindow(sb_container_->hwnd());
212 } 212 }
213 } 213 }
214 214
215 //////////////////////////////////////////////////////////////////////////////// 215 ////////////////////////////////////////////////////////////////////////////////
216 // NativeScrollBarWin, View overrides: 216 // NativeScrollBarWin, View overrides:
217 217
218 void NativeScrollBarWin::Layout() { 218 void NativeScrollBarWin::Layout() {
219 SetBoundsRect(native_scroll_bar_->GetContentsBounds()); 219 SetBoundsRect(native_scroll_bar_->GetLocalBounds());
220 NativeControlWin::Layout(); 220 NativeControlWin::Layout();
221 } 221 }
222 222
223 gfx::Size NativeScrollBarWin::GetPreferredSize() { 223 gfx::Size NativeScrollBarWin::GetPreferredSize() {
224 if (native_scroll_bar_->IsHorizontal()) 224 if (native_scroll_bar_->IsHorizontal())
225 return gfx::Size(0, GetHorizontalScrollBarHeight()); 225 return gfx::Size(0, GetHorizontalScrollBarHeight());
226 return gfx::Size(GetVerticalScrollBarWidth(), 0); 226 return gfx::Size(GetVerticalScrollBarWidth(), 0);
227 } 227 }
228 228
229 bool NativeScrollBarWin::OnKeyPressed(const KeyEvent& event) { 229 bool NativeScrollBarWin::OnKeyPressed(const KeyEvent& event) {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() { 340 int NativeScrollBarWrapper::GetHorizontalScrollBarHeight() {
341 return GetSystemMetrics(SM_CYHSCROLL); 341 return GetSystemMetrics(SM_CYHSCROLL);
342 } 342 }
343 343
344 // static 344 // static
345 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { 345 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() {
346 return GetSystemMetrics(SM_CXVSCROLL); 346 return GetSystemMetrics(SM_CXVSCROLL);
347 } 347 }
348 348
349 } // namespace views 349 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698