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

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

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/gfx/win/hwnd_util.cc ('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 <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 10
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value)); 752 hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value));
753 } 753 }
754 } 754 }
755 755
756 bool HWNDMessageHandler::SetTitle(const base::string16& title) { 756 bool HWNDMessageHandler::SetTitle(const base::string16& title) {
757 base::string16 current_title; 757 base::string16 current_title;
758 size_t len_with_null = GetWindowTextLength(hwnd()) + 1; 758 size_t len_with_null = GetWindowTextLength(hwnd()) + 1;
759 if (len_with_null == 1 && title.length() == 0) 759 if (len_with_null == 1 && title.length() == 0)
760 return false; 760 return false;
761 if (len_with_null - 1 == title.length() && 761 if (len_with_null - 1 == title.length() &&
762 GetWindowText( 762 GetWindowText(hwnd(),
763 hwnd(), WriteInto(&current_title, len_with_null), len_with_null) && 763 base::WriteInto(&current_title, len_with_null),
764 len_with_null) &&
764 current_title == title) 765 current_title == title)
765 return false; 766 return false;
766 SetWindowText(hwnd(), title.c_str()); 767 SetWindowText(hwnd(), title.c_str());
767 return true; 768 return true;
768 } 769 }
769 770
770 void HWNDMessageHandler::SetCursor(HCURSOR cursor) { 771 void HWNDMessageHandler::SetCursor(HCURSOR cursor) {
771 if (cursor) { 772 if (cursor) {
772 previous_cursor_ = ::SetCursor(cursor); 773 previous_cursor_ = ::SetCursor(cursor);
773 current_cursor_ = cursor; 774 current_cursor_ = cursor;
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2738 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); 2739 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW);
2739 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); 2740 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW);
2740 } 2741 }
2741 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want 2742 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want
2742 // to notify our children too, since we can have MDI child windows who need to 2743 // to notify our children too, since we can have MDI child windows who need to
2743 // update their appearance. 2744 // update their appearance.
2744 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); 2745 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL);
2745 } 2746 }
2746 2747
2747 } // namespace views 2748 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/win/hwnd_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698