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

Side by Side Diff: chrome/browser/ui/views/tabs/window_finder_win.cc

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ScopedHICON instead of HICON. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/views/tabs/window_finder.h" 5 #include "chrome/browser/ui/views/tabs/window_finder.h"
6 6
7 #include "base/win/scoped_gdi_object.h" 7 #include "base/win/scoped_gdi_object.h"
8 #include "base/win/windows_version.h" 8 #include "base/win/windows_version.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // WS_EX_LAYERED windows then there are effectively holes on the screen 100 // WS_EX_LAYERED windows then there are effectively holes on the screen
101 // that the user can't reattach tabs to. So we ignore them. This is a bit 101 // that the user can't reattach tabs to. So we ignore them. This is a bit
102 // problematic in so far as WS_EX_LAYERED windows need not be totally 102 // problematic in so far as WS_EX_LAYERED windows need not be totally
103 // transparent in which case we treat chrome windows as not being obscured 103 // transparent in which case we treat chrome windows as not being obscured
104 // when they really are, but this is better than not being able to 104 // when they really are, but this is better than not being able to
105 // reattach tabs. 105 // reattach tabs.
106 return false; 106 return false;
107 } 107 }
108 108
109 // hwnd is at the point. Make sure the point is within the windows region. 109 // hwnd is at the point. Make sure the point is within the windows region.
110 if (GetWindowRgn(hwnd, tmp_region_.Get()) == ERROR) { 110 if (GetWindowRgn(hwnd, tmp_region_.get()) == ERROR) {
111 // There's no region on the window and the window contains the point. Stop 111 // There's no region on the window and the window contains the point. Stop
112 // iterating. 112 // iterating.
113 return true; 113 return true;
114 } 114 }
115 115
116 // The region is relative to the window's rect. 116 // The region is relative to the window's rect.
117 BOOL is_point_in_region = PtInRegion(tmp_region_.Get(), 117 BOOL is_point_in_region = PtInRegion(
118 screen_loc_.x() - r.left, screen_loc_.y() - r.top); 118 tmp_region_.get(), screen_loc_.x() - r.left, screen_loc_.y() - r.top);
119 tmp_region_ = CreateRectRgn(0, 0, 0, 0); 119 tmp_region_.reset(CreateRectRgn(0, 0, 0, 0));
120 // Stop iterating if the region contains the point. 120 // Stop iterating if the region contains the point.
121 return !!is_point_in_region; 121 return !!is_point_in_region;
122 } 122 }
123 123
124 private: 124 private:
125 TopMostFinder(HWND window, 125 TopMostFinder(HWND window,
126 const gfx::Point& screen_loc, 126 const gfx::Point& screen_loc,
127 const std::set<HWND>& ignore) 127 const std::set<HWND>& ignore)
128 : BaseWindowFinder(ignore), 128 : BaseWindowFinder(ignore),
129 target_(window), 129 target_(window),
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 chrome::HostDesktopType host_desktop_type, 263 chrome::HostDesktopType host_desktop_type,
264 const gfx::Point& screen_point, 264 const gfx::Point& screen_point,
265 const std::set<gfx::NativeWindow>& ignore) { 265 const std::set<gfx::NativeWindow>& ignore) {
266 #if defined(USE_ASH) 266 #if defined(USE_ASH)
267 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH) 267 if (host_desktop_type == chrome::HOST_DESKTOP_TYPE_ASH)
268 return GetLocalProcessWindowAtPointAsh(screen_point, ignore); 268 return GetLocalProcessWindowAtPointAsh(screen_point, ignore);
269 #endif 269 #endif
270 return LocalProcessWindowFinder::GetProcessWindowAtPoint( 270 return LocalProcessWindowFinder::GetProcessWindowAtPoint(
271 screen_point, RemapIgnoreSet(ignore)); 271 screen_point, RemapIgnoreSet(ignore));
272 } 272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698