OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 "content/browser/web_contents/aura/overscroll_layer_wrapper.h" |
| 6 |
| 7 #include "ui/aura/window.h" |
| 8 #include "ui/compositor/layer.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 OverscrollLayerWrapper::OverscrollLayerWrapper(scoped_ptr<aura::Window> window) |
| 13 : layer_(nullptr), |
| 14 window_(window.Pass()) { |
| 15 } |
| 16 |
| 17 OverscrollLayerWrapper::OverscrollLayerWrapper(scoped_ptr<ui::Layer> layer) |
| 18 : layer_(layer.Pass()), |
| 19 window_(nullptr) { |
| 20 } |
| 21 |
| 22 OverscrollLayerWrapper::~OverscrollLayerWrapper() { |
| 23 } |
| 24 |
| 25 scoped_ptr<ui::Layer> OverscrollLayerWrapper::AcquireLayer() { |
| 26 return layer_.Pass(); |
| 27 } |
| 28 |
| 29 scoped_ptr<aura::Window> OverscrollLayerWrapper::AcquireWindow() { |
| 30 return window_.Pass(); |
| 31 } |
| 32 |
| 33 gfx::Rect OverscrollLayerWrapper::GetBounds() { |
| 34 if (layer_) |
| 35 return layer_->bounds(); |
| 36 DCHECK(window_); |
| 37 return window_->bounds(); |
| 38 } |
| 39 |
| 40 } // namespace content |
OLD | NEW |