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

Side by Side Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views.cc

Issue 2173033002: Make various views SetShape() methods take an unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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/apps/chrome_native_app_window_views.h" 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "apps/ui/views/app_window_frame_view.h" 10 #include "apps/ui/views/app_window_frame_view.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 widget()->SetFullscreen(fullscreen_types != AppWindow::FULLSCREEN_TYPE_NONE); 348 widget()->SetFullscreen(fullscreen_types != AppWindow::FULLSCREEN_TYPE_NONE);
349 } 349 }
350 350
351 bool ChromeNativeAppWindowViews::IsFullscreenOrPending() const { 351 bool ChromeNativeAppWindowViews::IsFullscreenOrPending() const {
352 return widget()->IsFullscreen(); 352 return widget()->IsFullscreen();
353 } 353 }
354 354
355 void ChromeNativeAppWindowViews::UpdateShape(std::unique_ptr<SkRegion> region) { 355 void ChromeNativeAppWindowViews::UpdateShape(std::unique_ptr<SkRegion> region) {
356 shape_ = std::move(region); 356 shape_ = std::move(region);
357 widget()->SetShape(shape() ? new SkRegion(*shape()) : nullptr); 357 widget()->SetShape(
358 base::WrapUnique(shape() ? new SkRegion(*shape()) : nullptr));
sadrul 2016/07/23 00:59:16 This could also be: shape() ? base::MakeUnique<
Lei Zhang 2016/07/25 17:57:00 Done.
358 widget()->OnSizeConstraintsChanged(); 359 widget()->OnSizeConstraintsChanged();
359 } 360 }
360 361
361 bool ChromeNativeAppWindowViews::HasFrameColor() const { 362 bool ChromeNativeAppWindowViews::HasFrameColor() const {
362 return has_frame_color_; 363 return has_frame_color_;
363 } 364 }
364 365
365 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const { 366 SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const {
366 return active_frame_color_; 367 return active_frame_color_;
367 } 368 }
(...skipping 16 matching lines...) Expand all
384 InitializePanelWindow(create_params); 385 InitializePanelWindow(create_params);
385 } else { 386 } else {
386 InitializeDefaultWindow(create_params); 387 InitializeDefaultWindow(create_params);
387 } 388 }
388 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 389 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
389 Profile::FromBrowserContext(app_window->browser_context()), 390 Profile::FromBrowserContext(app_window->browser_context()),
390 widget()->GetFocusManager(), 391 widget()->GetFocusManager(),
391 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, 392 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY,
392 NULL)); 393 NULL));
393 } 394 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/mus/native_widget_mus.h » ('j') | ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698