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

Side by Side Diff: chrome/browser/ui/extensions/native_shell_window.cc

Issue 11028125: Remove legacy draggable region code and refactor to share common draggable region code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/extensions/native_shell_window.h"
6
7 #include "chrome/common/extensions/draggable_region.h"
8
9 NativeShellWindow::NativeShellWindow(const ShellWindow::CreateParams& params)
10 : frameless_(params.frame == ShellWindow::CreateParams::FRAME_NONE) {
11 }
12
13 NativeShellWindow::~NativeShellWindow() {
14 }
15
16 void NativeShellWindow::UpdateDraggableRegions(
17 const std::vector<extensions::DraggableRegion>& regions) {
18 // Draggable region is not supported for non-frameless window.
19 if (!frameless_)
20 return;
21
22 draggable_regions_.reset(new SkRegion);
23 for (std::vector<extensions::DraggableRegion>::const_iterator iter =
24 regions.begin();
25 iter != regions.end(); ++iter) {
26 const extensions::DraggableRegion& region = *iter;
27 draggable_regions_->op(
28 region.bounds.x(),
29 region.bounds.y(),
30 region.bounds.right(),
31 region.bounds.bottom(),
32 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
33 }
34 }
35
36 bool NativeShellWindow::IsInsideDraggableRegions(int x, int y) const {
37 return frameless_ && draggable_regions_ && draggable_regions_->contains(x, y);
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698