Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Unified Diff: ash/magnifier/magnified_cursor.cc

Issue 10388141: Full-screen Magnifier: Support warping the cursor on the edge (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
+}
+
+}
+}

Powered by Google App Engine
This is Rietveld 408576698