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

Side by Side Diff: views/controls/native_control.cc

Issue 2812026: Auto-size the views version of the options dialog. (Closed)
Patch Set: Fix autosizing issue with gtk pref pages in chromeos options dialog. Created 10 years, 5 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
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/native_control.h" 5 #include "views/controls/native_control.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlapp.h> 8 #include <atlapp.h>
9 #include <atlcrack.h> 9 #include <atlcrack.h>
10 #include <atlframe.h> 10 #include <atlframe.h>
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // This message ensures that the focus border is shown. 194 // This message ensures that the focus border is shown.
195 ::SendMessage(container_->GetControl(), 195 ::SendMessage(container_->GetControl(),
196 WM_CHANGEUISTATE, 196 WM_CHANGEUISTATE,
197 MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 197 MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
198 0); 198 0);
199 } 199 }
200 } 200 }
201 201
202 void NativeControl::ViewHierarchyChanged(bool is_add, View *parent, 202 void NativeControl::ViewHierarchyChanged(bool is_add, View *parent,
203 View *child) { 203 View *child) {
204 if (is_add && child == this && GetWidget()) { 204 if (is_add && parent != this && !container_ && GetWidget()) {
205 ValidateNativeControl(); 205 ValidateNativeControl();
206 Layout(); 206 Layout();
207 } 207 }
208 } 208 }
209 209
210 void NativeControl::Layout() { 210 void NativeControl::Layout() {
211 if (!container_ && GetWidget()) 211 if (!container_ && GetWidget())
212 ValidateNativeControl(); 212 ValidateNativeControl();
213 213
214 if (hwnd_view_) { 214 if (hwnd_view_) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 reinterpret_cast<WNDPROC>(original_handler)); 373 reinterpret_cast<WNDPROC>(original_handler));
374 RemoveProp(window, kHandlerKey); 374 RemoveProp(window, kHandlerKey);
375 RemoveProp(window, kNativeControlKey); 375 RemoveProp(window, kNativeControlKey);
376 } 376 }
377 377
378 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 378 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
379 message, w_param, l_param); 379 message, w_param, l_param);
380 } 380 }
381 381
382 } // namespace views 382 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_scroll_view_container.cc ('k') | views/controls/scrollbar/native_scroll_bar_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698