shaped_app_window_targeter.cc revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1c55a96383497a772a307b346368133960b02ad03Eric Laurent// Copyright 2014 The Chromium Authors. All rights reserved.
2c55a96383497a772a307b346368133960b02ad03Eric Laurent// Use of this source code is governed by a BSD-style license that can be
3c55a96383497a772a307b346368133960b02ad03Eric Laurent// found in the LICENSE file.
4c55a96383497a772a307b346368133960b02ad03Eric Laurent
5c55a96383497a772a307b346368133960b02ad03Eric Laurent#include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h"
6c55a96383497a772a307b346368133960b02ad03Eric Laurent
7c55a96383497a772a307b346368133960b02ad03Eric Laurent#include "chrome/browser/ui/views/apps/native_app_window_views.h"
8c55a96383497a772a307b346368133960b02ad03Eric Laurent#include "ui/gfx/path.h"
9c55a96383497a772a307b346368133960b02ad03Eric Laurent
10c55a96383497a772a307b346368133960b02ad03Eric LaurentShapedAppWindowTargeter::ShapedAppWindowTargeter(
11c55a96383497a772a307b346368133960b02ad03Eric Laurent    aura::Window* window,
12c55a96383497a772a307b346368133960b02ad03Eric Laurent    NativeAppWindowViews* app_window)
13c55a96383497a772a307b346368133960b02ad03Eric Laurent    : wm::MaskedWindowTargeter(window),
14c55a96383497a772a307b346368133960b02ad03Eric Laurent      app_window_(app_window) {
15c55a96383497a772a307b346368133960b02ad03Eric Laurent}
16c55a96383497a772a307b346368133960b02ad03Eric Laurent
17c55a96383497a772a307b346368133960b02ad03Eric LaurentShapedAppWindowTargeter::~ShapedAppWindowTargeter() {
18c55a96383497a772a307b346368133960b02ad03Eric Laurent}
19c55a96383497a772a307b346368133960b02ad03Eric Laurent
20c55a96383497a772a307b346368133960b02ad03Eric Laurentbool ShapedAppWindowTargeter::GetHitTestMask(aura::Window* window,
21c55a96383497a772a307b346368133960b02ad03Eric Laurent                                             gfx::Path* mask) const {
22c55a96383497a772a307b346368133960b02ad03Eric Laurent  SkRegion* shape = app_window_->shape();
23c55a96383497a772a307b346368133960b02ad03Eric Laurent  return shape ? shape->getBoundaryPath(mask) : false;
24c55a96383497a772a307b346368133960b02ad03Eric Laurent}
25c55a96383497a772a307b346368133960b02ad03Eric Laurent