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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 10951033: Plumb ClearNativeFocus to DesktopRootWindowHostWin. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: get rid of FocusNativeView Created 8 years, 3 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 | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | 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) 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/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 } else { 705 } else {
706 fwi.dwFlags = FLASHW_STOP; 706 fwi.dwFlags = FLASHW_STOP;
707 } 707 }
708 FlashWindowEx(&fwi); 708 FlashWindowEx(&fwi);
709 } 709 }
710 710
711 void HWNDMessageHandler::ClearNativeFocus() { 711 void HWNDMessageHandler::ClearNativeFocus() {
712 ::SetFocus(hwnd()); 712 ::SetFocus(hwnd());
713 } 713 }
714 714
715 void HWNDMessageHandler::FocusHWND(HWND hwnd) {
716 // Only reset focus if hwnd is not already focused.
717 if (hwnd && ::GetFocus() != hwnd)
718 ::SetFocus(hwnd);
719 }
720
721 void HWNDMessageHandler::SetCapture() { 715 void HWNDMessageHandler::SetCapture() {
722 DCHECK(!HasCapture()); 716 DCHECK(!HasCapture());
723 ::SetCapture(hwnd()); 717 ::SetCapture(hwnd());
724 } 718 }
725 719
726 void HWNDMessageHandler::ReleaseCapture() { 720 void HWNDMessageHandler::ReleaseCapture() {
727 ::ReleaseCapture(); 721 ::ReleaseCapture();
728 } 722 }
729 723
730 bool HWNDMessageHandler::HasCapture() const { 724 bool HWNDMessageHandler::HasCapture() const {
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 DwmExtendFrameIntoClientArea(hwnd(), &m); 2091 DwmExtendFrameIntoClientArea(hwnd(), &m);
2098 } 2092 }
2099 if (window_pos->flags & SWP_SHOWWINDOW) 2093 if (window_pos->flags & SWP_SHOWWINDOW)
2100 delegate_->HandleVisibilityChanged(true); 2094 delegate_->HandleVisibilityChanged(true);
2101 else if (window_pos->flags & SWP_HIDEWINDOW) 2095 else if (window_pos->flags & SWP_HIDEWINDOW)
2102 delegate_->HandleVisibilityChanged(false); 2096 delegate_->HandleVisibilityChanged(false);
2103 SetMsgHandled(FALSE); 2097 SetMsgHandled(FALSE);
2104 } 2098 }
2105 2099
2106 } // namespace views 2100 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698