OLD | NEW |
(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 "ash/magnifier/magnified_cursor.h" |
| 6 |
| 7 #include "ui/aura/root_window.h" |
| 8 #include "ui/base/resource/resource_bundle.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "grit/ui_resources.h" |
| 11 |
| 12 namespace ash { |
| 13 namespace internal { |
| 14 |
| 15 MagnifiedCursor::MagnifiedCursor(aura::RootWindow* root_window) |
| 16 : root_window_(root_window) { |
| 17 layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); |
| 18 layer_->set_delegate(this); |
| 19 layer_->SetVisible(false); |
| 20 } |
| 21 |
| 22 void MagnifiedCursor::SetVisible(bool show) { |
| 23 layer_->SetVisible(show); |
| 24 } |
| 25 |
| 26 void MagnifiedCursor::MovePointer(gfx::Point position) { |
| 27 gfx::Rect rect(position.x() - 5, position.y() -5 , 10, 10); |
| 28 layer_->SetBounds(rect); |
| 29 } |
| 30 |
| 31 // ui::LayerDelegate implementation: |
| 32 void MagnifiedCursor::OnPaintLayer(gfx::Canvas* canvas) { |
| 33 // TODO(yoshiki): Draw a magnified cursor. |
| 34 } |
| 35 |
| 36 } |
| 37 } |
OLD | NEW |