Index: content/browser/web_contents/aura/overscroll_layer_wrapper.cc |
diff --git a/content/browser/web_contents/aura/overscroll_layer_wrapper.cc b/content/browser/web_contents/aura/overscroll_layer_wrapper.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..474c328366840b169042701d15dbf36ad3b8aaa3 |
--- /dev/null |
+++ b/content/browser/web_contents/aura/overscroll_layer_wrapper.cc |
@@ -0,0 +1,40 @@ |
+// Copyright 2015 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 "content/browser/web_contents/aura/overscroll_layer_wrapper.h" |
+ |
+#include "ui/aura/window.h" |
+#include "ui/compositor/layer.h" |
+ |
+namespace content { |
+ |
+OverscrollLayerWrapper::OverscrollLayerWrapper(scoped_ptr<aura::Window> window) |
+ : layer_(nullptr), |
+ window_(window.Pass()) { |
+} |
+ |
+OverscrollLayerWrapper::OverscrollLayerWrapper(scoped_ptr<ui::Layer> layer) |
+ : layer_(layer.Pass()), |
+ window_(nullptr) { |
+} |
+ |
+OverscrollLayerWrapper::~OverscrollLayerWrapper() { |
+} |
+ |
+scoped_ptr<ui::Layer> OverscrollLayerWrapper::AcquireLayer() { |
+ return layer_.Pass(); |
+} |
+ |
+scoped_ptr<aura::Window> OverscrollLayerWrapper::AcquireWindow() { |
+ return window_.Pass(); |
+} |
+ |
+gfx::Rect OverscrollLayerWrapper::GetBounds() { |
+ if (layer_) |
+ return layer_->bounds(); |
+ DCHECK(window_); |
+ return window_->bounds(); |
+} |
+ |
+} // namespace content |