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

Side by Side Diff: ui/views/widget/native_widget_win.cc

Issue 10826160: Restore NativeWidgetWin::OnSetIcon to eliminate classic theme titlebar flickering. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/widget/native_widget_win.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/widget/native_widget_win.h" 5 #include "ui/views/widget/native_widget_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 1999 }
2000 2000
2001 void NativeWidgetWin::OnSetFocus(HWND old_focused_window) { 2001 void NativeWidgetWin::OnSetFocus(HWND old_focused_window) {
2002 delegate_->OnNativeFocus(old_focused_window); 2002 delegate_->OnNativeFocus(old_focused_window);
2003 InputMethod* input_method = GetWidget()->GetInputMethodDirect(); 2003 InputMethod* input_method = GetWidget()->GetInputMethodDirect();
2004 if (input_method) 2004 if (input_method)
2005 input_method->OnFocus(); 2005 input_method->OnFocus();
2006 SetMsgHandled(FALSE); 2006 SetMsgHandled(FALSE);
2007 } 2007 }
2008 2008
2009 LRESULT NativeWidgetWin::OnSetIcon(UINT size_type, HICON new_icon) {
2010 // Use a ScopedRedrawLock to avoid weird non-client painting.
2011 return DefWindowProcWithRedrawLock(WM_SETICON, size_type,
2012 reinterpret_cast<LPARAM>(new_icon));
2013 }
2014
2009 LRESULT NativeWidgetWin::OnSetText(const wchar_t* text) { 2015 LRESULT NativeWidgetWin::OnSetText(const wchar_t* text) {
2010 // DefWindowProc for WM_SETTEXT does weird non-client painting, so we need to 2016 // Use a ScopedRedrawLock to avoid weird non-client painting.
2011 // call it inside a ScopedRedrawLock.
2012 return DefWindowProcWithRedrawLock(WM_SETTEXT, NULL, 2017 return DefWindowProcWithRedrawLock(WM_SETTEXT, NULL,
2013 reinterpret_cast<LPARAM>(text)); 2018 reinterpret_cast<LPARAM>(text));
2014 } 2019 }
2015 2020
2016 void NativeWidgetWin::OnSettingChange(UINT flags, const wchar_t* section) { 2021 void NativeWidgetWin::OnSettingChange(UINT flags, const wchar_t* section) {
2017 if (!GetParent() && (flags == SPI_SETWORKAREA) && 2022 if (!GetParent() && (flags == SPI_SETWORKAREA) &&
2018 !GetWidget()->widget_delegate()->WillProcessWorkAreaChange()) { 2023 !GetWidget()->widget_delegate()->WillProcessWorkAreaChange()) {
2019 // Fire a dummy SetWindowPos() call, so we'll trip the code in 2024 // Fire a dummy SetWindowPos() call, so we'll trip the code in
2020 // OnWindowPosChanging() below that notices work area changes. 2025 // OnWindowPosChanging() below that notices work area changes.
2021 ::SetWindowPos(GetNativeView(), 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | 2026 ::SetWindowPos(GetNativeView(), 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
2761 // static 2766 // static
2762 bool NativeWidgetPrivate::IsTouchDown() { 2767 bool NativeWidgetPrivate::IsTouchDown() {
2763 // This currently isn't necessary because we're not generating touch events on 2768 // This currently isn't necessary because we're not generating touch events on
2764 // windows. When we do, this will need to be updated. 2769 // windows. When we do, this will need to be updated.
2765 return false; 2770 return false;
2766 } 2771 }
2767 2772
2768 } // namespace internal 2773 } // namespace internal
2769 2774
2770 } // namespace views 2775 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698