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

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

Issue 602013002: [Ash] ShapedAppWindowTargeter treats empty shapes as empty hit test masks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Treat empty shapes the same as normal shapes. Created 6 years, 2 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 | « no previous file | 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 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/shaped_app_window_targeter.h" 5 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
6 6
7 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" 7 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
8 #include "ui/gfx/path.h" 8 #include "ui/gfx/path.h"
9 9
10 ShapedAppWindowTargeter::ShapedAppWindowTargeter( 10 ShapedAppWindowTargeter::ShapedAppWindowTargeter(
11 aura::Window* window, 11 aura::Window* window,
12 ChromeNativeAppWindowViews* app_window) 12 ChromeNativeAppWindowViews* app_window)
13 : wm::MaskedWindowTargeter(window), app_window_(app_window) {} 13 : wm::MaskedWindowTargeter(window), app_window_(app_window) {}
14 14
15 ShapedAppWindowTargeter::~ShapedAppWindowTargeter() { 15 ShapedAppWindowTargeter::~ShapedAppWindowTargeter() {
16 } 16 }
17 17
18 bool ShapedAppWindowTargeter::GetHitTestMask(aura::Window* window, 18 bool ShapedAppWindowTargeter::GetHitTestMask(aura::Window* window,
19 gfx::Path* mask) const { 19 gfx::Path* mask) const {
20 SkRegion* shape = app_window_->shape(); 20 SkRegion* shape = app_window_->shape();
21 return shape ? shape->getBoundaryPath(mask) : false; 21 if (!shape)
22 return false;
23
24 shape->getBoundaryPath(mask);
25 return true;
22 } 26 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698