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

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

Issue 1746013002: Hide/show widget on Windows screen lock/unlock Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 4 years, 9 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
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/views/win/hwnd_message_handler_delegate.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) 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 <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <tchar.h> 10 #include <tchar.h>
(...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2294 if (sent_window_size_changing_) { 2294 if (sent_window_size_changing_) {
2295 sent_window_size_changing_ = false; 2295 sent_window_size_changing_ = false;
2296 delegate_->HandleWindowSizeChanged(); 2296 delegate_->HandleWindowSizeChanged();
2297 } 2297 }
2298 SetMsgHandled(FALSE); 2298 SetMsgHandled(FALSE);
2299 } 2299 }
2300 2300
2301 void HWNDMessageHandler::OnSessionChange(WPARAM status_code) { 2301 void HWNDMessageHandler::OnSessionChange(WPARAM status_code) {
2302 // Direct3D presents are ignored while the screen is locked, so force the 2302 // Direct3D presents are ignored while the screen is locked, so force the
2303 // window to be redrawn on unlock. 2303 // window to be redrawn on unlock.
2304 if (status_code == WTS_SESSION_UNLOCK) 2304 if (status_code == WTS_SESSION_UNLOCK) {
2305 ForceRedrawWindow(10); 2305 ForceRedrawWindow(10);
2306 if (IsVisible())
2307 delegate_->HandleSoftVisibilityChanged(true);
2308 } else if (status_code == WTS_SESSION_LOCK) {
2309 if (IsVisible())
2310 delegate_->HandleSoftVisibilityChanged(false);
2311 }
2306 } 2312 }
2307 2313
2308 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { 2314 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) {
2309 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); 2315 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr());
2310 for (size_t i = 0; i < touch_events.size() && ref; ++i) 2316 for (size_t i = 0; i < touch_events.size() && ref; ++i)
2311 delegate_->HandleTouchEvent(touch_events[i]); 2317 delegate_->HandleTouchEvent(touch_events[i]);
2312 } 2318 }
2313 2319
2314 void HWNDMessageHandler::ResetTouchDownContext() { 2320 void HWNDMessageHandler::ResetTouchDownContext() {
2315 touch_down_contexts_--; 2321 touch_down_contexts_--;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size()); 2636 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size());
2631 ResetWindowRegion(false, true); 2637 ResetWindowRegion(false, true);
2632 } 2638 }
2633 2639
2634 if (direct_manipulation_helper_) 2640 if (direct_manipulation_helper_)
2635 direct_manipulation_helper_->SetBounds(bounds_in_pixels); 2641 direct_manipulation_helper_->SetBounds(bounds_in_pixels);
2636 } 2642 }
2637 2643
2638 2644
2639 } // namespace views 2645 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.cc ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698