Index: ash/magnifier/magnified_cursor.cc |
diff --git a/ash/magnifier/magnified_cursor.cc b/ash/magnifier/magnified_cursor.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..24609dc45a462360afe50b5ef1a60711eb7ad030 |
--- /dev/null |
+++ b/ash/magnifier/magnified_cursor.cc |
@@ -0,0 +1,37 @@ |
+// 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 "ash/magnifier/magnified_cursor.h" |
+ |
+#include "ui/aura/root_window.h" |
+#include "ui/base/resource/resource_bundle.h" |
+#include "third_party/skia/include/core/SkBitmap.h" |
+#include "grit/ui_resources.h" |
+ |
+namespace ash { |
+namespace internal { |
+ |
+MagnifiedCursor::MagnifiedCursor(aura::RootWindow* root_window) |
+ : root_window_(root_window) { |
+ layer_.reset(new ui::Layer(ui::LAYER_TEXTURED)); |
+ layer_->set_delegate(this); |
+ layer_->SetVisible(false); |
+} |
+ |
+void MagnifiedCursor::SetVisible(bool show) { |
+ layer_->SetVisible(show); |
+} |
+ |
+void MagnifiedCursor::MovePointer(gfx::Point position) { |
+ gfx::Rect rect(position.x() - 5, position.y() -5 , 10, 10); |
+ layer_->SetBounds(rect); |
+} |
+ |
+// ui::LayerDelegate implementation: |
+void MagnifiedCursor::OnPaintLayer(gfx::Canvas* canvas) { |
+ // TODO(yoshiki): Draw a magnified cursor. |
+} |
+ |
+} |
+} |