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

Unified Diff: components/native_app_window/draggable_region.cc

Issue 616253002: Extract NativeAppWindow from src/extensions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: might fix athena. similarity=33 Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/native_app_window/draggable_region.h ('k') | components/native_app_window/native_app_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/native_app_window/draggable_region.cc
diff --git a/components/native_app_window/draggable_region.cc b/components/native_app_window/draggable_region.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4648a141cfb8fd9d733d84785d1c992ed9458711
--- /dev/null
+++ b/components/native_app_window/draggable_region.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/native_app_window/draggable_region.h"
+
+#include "third_party/skia/include/core/SkRegion.h"
+
+namespace native_app_window {
+
+DraggableRegion::DraggableRegion() : draggable(false) {
+}
+
+SkRegion* RawDraggableRegionsToSkRegion(
+ const std::vector<DraggableRegion>& regions) {
+ SkRegion* sk_region = new SkRegion;
+ for (std::vector<DraggableRegion>::const_iterator iter = regions.begin();
+ iter != regions.end();
+ ++iter) {
+ const DraggableRegion& region = *iter;
+ sk_region->op(
+ region.bounds.x(),
+ region.bounds.y(),
+ region.bounds.right(),
+ region.bounds.bottom(),
+ region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
+ }
+ return sk_region;
+}
+
+} // namespace native_app_window
« no previous file with comments | « components/native_app_window/draggable_region.h ('k') | components/native_app_window/native_app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698