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

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

Issue 259052: Reverting the NativeViewHostWin focus refactoring.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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
« no previous file with comments | « views/controls/native/native_view_host_wrapper.h ('k') | views/controls/native_control_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 HWND NativeControl::GetNativeControlHWND() { 282 HWND NativeControl::GetNativeControlHWND() {
283 if (container_) 283 if (container_)
284 return container_->GetControl(); 284 return container_->GetControl();
285 else 285 else
286 return NULL; 286 return NULL;
287 } 287 }
288 288
289 void NativeControl::NativeControlDestroyed() { 289 void NativeControl::NativeControlDestroyed() {
290 if (hwnd_view_)
291 hwnd_view_->Detach();
290 container_ = NULL; 292 container_ = NULL;
291 } 293 }
292 294
293 void NativeControl::SetVisible(bool f) { 295 void NativeControl::SetVisible(bool f) {
294 if (f != IsVisible()) { 296 if (f != IsVisible()) {
295 View::SetVisible(f); 297 View::SetVisible(f);
296 if (!f && container_) { 298 if (!f && container_) {
297 ::DestroyWindow(*container_); 299 ::DestroyWindow(*container_);
298 } else if (f && !container_) { 300 } else if (f && !container_) {
299 ValidateNativeControl(); 301 ValidateNativeControl();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 reinterpret_cast<WNDPROC>(original_handler)); 379 reinterpret_cast<WNDPROC>(original_handler));
378 RemoveProp(window, kHandlerKey); 380 RemoveProp(window, kHandlerKey);
379 RemoveProp(window, kNativeControlKey); 381 RemoveProp(window, kNativeControlKey);
380 } 382 }
381 383
382 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window, 384 return CallWindowProc(reinterpret_cast<WNDPROC>(original_handler), window,
383 message, w_param, l_param); 385 message, w_param, l_param);
384 } 386 }
385 387
386 } // namespace views 388 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/native/native_view_host_wrapper.h ('k') | views/controls/native_control_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698