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

Side by Side Diff: chrome/browser/ui/views/panels/panel_view.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 "chrome/browser/ui/views/panels/panel_view.h" 5 #include "chrome/browser/ui/views/panels/panel_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 #if defined(OS_WIN) 174 #if defined(OS_WIN)
175 // We only care about Windows 7 and later. 175 // We only care about Windows 7 and later.
176 if (base::win::GetVersion() < base::win::VERSION_WIN7) 176 if (base::win::GetVersion() < base::win::VERSION_WIN7)
177 return true; 177 return true;
178 178
179 HWND native_window = views::HWNDForWidget(panel_view_->window()); 179 HWND native_window = views::HWNDForWidget(panel_view_->window());
180 HICON app_icon = reinterpret_cast<HICON>( 180 HICON app_icon = reinterpret_cast<HICON>(
181 ::SendMessage(native_window, WM_GETICON, ICON_BIG, 0L)); 181 ::SendMessage(native_window, WM_GETICON, ICON_BIG, 0L));
182 if (!app_icon) 182 if (!app_icon)
183 return false; 183 return false;
184 scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(app_icon)); 184 std::unique_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(app_icon));
185 return bitmap.get() && 185 return bitmap.get() &&
186 bitmap->width() == panel::kPanelAppIconSize && 186 bitmap->width() == panel::kPanelAppIconSize &&
187 bitmap->height() == panel::kPanelAppIconSize; 187 bitmap->height() == panel::kPanelAppIconSize;
188 #else 188 #else
189 return true; 189 return true;
190 #endif 190 #endif
191 } 191 }
192 192
193 bool NativePanelTestingViews::VerifySystemMinimizeState() const { 193 bool NativePanelTestingViews::VerifySystemMinimizeState() const {
194 #if defined(OS_WIN) 194 #if defined(OS_WIN)
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 ui::win::PreventWindowFromPinning(views::HWNDForWidget(window_)); 329 ui::win::PreventWindowFromPinning(views::HWNDForWidget(window_));
330 #endif 330 #endif
331 331
332 #if defined(USE_X11) && !defined(OS_CHROMEOS) 332 #if defined(USE_X11) && !defined(OS_CHROMEOS)
333 // Swap the default non client event handler with one which handles resizes 333 // Swap the default non client event handler with one which handles resizes
334 // for panels entirely within Chrome. This is needed because it is not 334 // for panels entirely within Chrome. This is needed because it is not
335 // possible to tell when a resize performed by the window manager ends. 335 // possible to tell when a resize performed by the window manager ends.
336 views::DesktopWindowTreeHostX11* host = 336 views::DesktopWindowTreeHostX11* host =
337 views::DesktopWindowTreeHostX11::GetHostForXID( 337 views::DesktopWindowTreeHostX11::GetHostForXID(
338 window_->GetNativeView()->GetHost()->GetAcceleratedWidget()); 338 window_->GetNativeView()->GetHost()->GetAcceleratedWidget());
339 scoped_ptr<ui::EventHandler> resizer( 339 std::unique_ptr<ui::EventHandler> resizer(
340 new X11PanelResizer(panel_.get(), window_->GetNativeWindow())); 340 new X11PanelResizer(panel_.get(), window_->GetNativeWindow()));
341 host->SwapNonClientEventHandler(std::move(resizer)); 341 host->SwapNonClientEventHandler(std::move(resizer));
342 #endif 342 #endif
343 } 343 }
344 344
345 PanelView::~PanelView() { 345 PanelView::~PanelView() {
346 } 346 }
347 347
348 void PanelView::ShowPanel() { 348 void PanelView::ShowPanel() {
349 if (window_->IsVisible()) 349 if (window_->IsVisible())
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 // SWP_FRAMECHANGED flag must be called in order for the cached window data 1144 // SWP_FRAMECHANGED flag must be called in order for the cached window data
1145 // to be updated properly. 1145 // to be updated properly.
1146 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a spx 1146 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).a spx
1147 if (update_frame) { 1147 if (update_frame) {
1148 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0, 1148 ::SetWindowPos(native_window, NULL, 0, 0, 0, 0,
1149 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | 1149 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE |
1150 SWP_NOZORDER | SWP_NOACTIVATE); 1150 SWP_NOZORDER | SWP_NOACTIVATE);
1151 } 1151 }
1152 } 1152 }
1153 #endif 1153 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/panels/panel_view.h ('k') | chrome/browser/ui/views/panels/taskbar_window_thumbnailer_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698