| OLD | NEW |
| 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 else | 712 else |
| 713 *show_state = ui::SHOW_STATE_NORMAL; | 713 *show_state = ui::SHOW_STATE_NORMAL; |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 | 716 |
| 717 void NativeWidgetWin::SetWindowTitle(const string16& title) { | 717 void NativeWidgetWin::SetWindowTitle(const string16& title) { |
| 718 SetWindowText(GetNativeView(), title.c_str()); | 718 SetWindowText(GetNativeView(), title.c_str()); |
| 719 SetAccessibleName(title); | 719 SetAccessibleName(title); |
| 720 } | 720 } |
| 721 | 721 |
| 722 void NativeWidgetWin::SetWindowIcons(const SkBitmap& window_icon, | 722 void NativeWidgetWin::SetWindowIcons(const gfx::ImageSkia& window_icon, |
| 723 const SkBitmap& app_icon) { | 723 const gfx::ImageSkia& app_icon) { |
| 724 if (!window_icon.isNull()) { | 724 if (!window_icon.isNull()) { |
| 725 HICON windows_icon = IconUtil::CreateHICONFromSkBitmap(window_icon); | 725 HICON windows_icon = IconUtil::CreateHICONFromSkBitmap(window_icon); |
| 726 // We need to make sure to destroy the previous icon, otherwise we'll leak | 726 // We need to make sure to destroy the previous icon, otherwise we'll leak |
| 727 // these GDI objects until we crash! | 727 // these GDI objects until we crash! |
| 728 HICON old_icon = reinterpret_cast<HICON>( | 728 HICON old_icon = reinterpret_cast<HICON>( |
| 729 SendMessage(GetNativeView(), WM_SETICON, ICON_SMALL, | 729 SendMessage(GetNativeView(), WM_SETICON, ICON_SMALL, |
| 730 reinterpret_cast<LPARAM>(windows_icon))); | 730 reinterpret_cast<LPARAM>(windows_icon))); |
| 731 if (old_icon) | 731 if (old_icon) |
| 732 DestroyIcon(old_icon); | 732 DestroyIcon(old_icon); |
| 733 } | 733 } |
| (...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2719 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2719 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2720 (GetKeyState(VK_RBUTTON) & 0x80) || | 2720 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2721 (GetKeyState(VK_MBUTTON) & 0x80) || | 2721 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2722 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2722 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2723 (GetKeyState(VK_XBUTTON2) & 0x80); | 2723 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2724 } | 2724 } |
| 2725 | 2725 |
| 2726 } // namespace internal | 2726 } // namespace internal |
| 2727 | 2727 |
| 2728 } // namespace views | 2728 } // namespace views |
| OLD | NEW |