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..9d8592880bf66737a3ccb12e3f70d051df927d2a |
--- /dev/null |
+++ b/ash/magnifier/magnified_cursor.cc |
@@ -0,0 +1,40 @@ |
+// 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) { |
piman
2012/05/18 03:09:49
root_window_ doesn't seem used at all. Remove?
|
+ 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); |
piman
2012/05/18 03:09:49
nit: space between - and 5.
|
+ layer_->SetBounds(rect); |
+} |
+ |
+// ui::LayerDelegate implementation: |
+void MagnifiedCursor::OnPaintLayer(gfx::Canvas* canvas) { |
+ // TODO(yoshiki): Draw a magnified cursor. |
+} |
+ |
+void MagnifiedCursor::OnDeviceScaleFactorChanged(float device_scale_factor) { |
+} |
+ |
+} // namespace internal |
+} // namespace ash |