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

Unified Diff: ui/aura/root_window.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: Make MagnificationController virtual class. 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
« ui/aura/root_window.h ('K') | « ui/aura/root_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window.cc
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index e6797dcd024fa26ceb2e6e6fe40a9336e38d2018..8f2f7bb68d0c362b70f1f7d49c3143a57dca74df 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -33,6 +33,8 @@
#include "ui/gfx/monitor.h"
#include "ui/gfx/screen.h"
+#include "ui/compositor/layer_type.h"
+
using std::vector;
namespace aura {
@@ -129,6 +131,7 @@ RootWindow::RootWindow(const gfx::Rect& initial_bounds)
defer_draw_scheduling_(false),
mouse_move_hold_count_(0),
should_hold_mouse_moves_(false),
+ force_hide_cursor_(false),
compositor_lock_(NULL),
draw_on_compositor_unlock_(false),
draw_trace_count_(0) {
@@ -166,7 +169,15 @@ void RootWindow::Init() {
Window::Init(ui::LAYER_NOT_DRAWN);
last_mouse_location_ =
ui::ConvertPointToDIP(layer(), host_->QueryMouseLocation());
- compositor()->SetRootLayer(layer());
+
+ magnification_layer_.reset(new ui::Layer(ui::LAYER_TEXTURED));
piman 2012/05/18 03:09:49 Does this need to be LAYER_TEXTURED? Since it has
+ magnification_layer_->SetVisible(false);
+ magnification_layer_->SetFillsBoundsOpaquely(true);
+ magnification_layer_->Add(layer());
+ magnification_layer_->SetVisible(true);
piman 2012/05/18 03:09:49 Is this layer needed at all? If it's just there to
+
+ compositor()->SetRootLayer(magnification_layer_.get());
+
SetBounds(
ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size())));
Show();
@@ -212,7 +223,15 @@ void RootWindow::SetCursor(gfx::NativeCursor cursor) {
host_->SetCursor(cursor);
}
+void RootWindow::SetForceHideCursor(bool hide) {
+ force_hide_cursor_ = hide;
+ ShowCursor(!hide);
piman 2012/05/18 03:09:49 This makes SetForceHideCursor and ShowCursor non-o
+}
+
void RootWindow::ShowCursor(bool show) {
+ if (force_hide_cursor_ && show)
+ show = false;
+
cursor_shown_ = show;
host_->ShowCursor(show);
}
@@ -311,6 +330,10 @@ bool RootWindow::DispatchScrollEvent(ScrollEvent* event) {
bool RootWindow::DispatchTouchEvent(TouchEvent* event) {
DispatchHeldMouseMove();
+
+ // Touch event should be transformed by magnifition transform matrix.
+ event->UpdateForRootTransform(magnification_layer()->transform());
+
if (ui::IsDIPEnabled()) {
float scale = ui::GetDeviceScaleFactor(layer());
ui::Transform transform = layer()->transform();
« ui/aura/root_window.h ('K') | « ui/aura/root_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698