| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/v2/public/view.h" | 5 #include "ui/v2/public/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "ui/compositor/layer_owner.h" | 10 #include "ui/compositor/layer_owner.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 class ViewLayerOwner : public ui::LayerOwner, | 118 class ViewLayerOwner : public ui::LayerOwner, |
| 119 public ui::LayerDelegate { | 119 public ui::LayerDelegate { |
| 120 public: | 120 public: |
| 121 explicit ViewLayerOwner(ui::Layer* layer) { | 121 explicit ViewLayerOwner(ui::Layer* layer) { |
| 122 layer_ = layer; | 122 layer_ = layer; |
| 123 } | 123 } |
| 124 ~ViewLayerOwner() {} | 124 ~ViewLayerOwner() {} |
| 125 | 125 |
| 126 private: | 126 private: |
| 127 // Overridden from ui::LayerDelegate: | 127 // Overridden from ui::LayerDelegate: |
| 128 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { | 128 virtual void OnPaintLayer(gfx::Canvas* canvas) override { |
| 129 // TODO(beng): paint processor. | 129 // TODO(beng): paint processor. |
| 130 } | 130 } |
| 131 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE { | 131 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override { |
| 132 // TODO(beng): ??? | 132 // TODO(beng): ??? |
| 133 } | 133 } |
| 134 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE { | 134 virtual base::Closure PrepareForLayerBoundsChange() override { |
| 135 return base::Bind(&ViewLayerOwner::OnLayerBoundsChanged, | 135 return base::Bind(&ViewLayerOwner::OnLayerBoundsChanged, |
| 136 base::Unretained(this)); | 136 base::Unretained(this)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void OnLayerBoundsChanged() { | 139 void OnLayerBoundsChanged() { |
| 140 // TODO(beng): ??? | 140 // TODO(beng): ??? |
| 141 } | 141 } |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(ViewLayerOwner); | 143 DISALLOW_COPY_AND_ASSIGN(ViewLayerOwner); |
| 144 }; | 144 }; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 DCHECK(layer_owner_.get()); | 293 DCHECK(layer_owner_.get()); |
| 294 layer_owner_.reset(); | 294 layer_owner_.reset(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 ui::Layer* View::AcquireLayer() { | 297 ui::Layer* View::AcquireLayer() { |
| 298 DCHECK(layer_owner_.get()); | 298 DCHECK(layer_owner_.get()); |
| 299 return layer_owner_->AcquireLayer(); | 299 return layer_owner_->AcquireLayer(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace v2 | 302 } // namespace v2 |
| OLD | NEW |