OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/window_properties.h" | 9 #include "ash/wm/window_properties.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 const content::NotificationDetails& details) { | 454 const content::NotificationDetails& details) { |
455 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); | 455 DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type); |
456 if (enabled_) | 456 if (enabled_) |
457 UpdateUseMinimalChrome(LAYOUT_YES); | 457 UpdateUseMinimalChrome(LAYOUT_YES); |
458 } | 458 } |
459 | 459 |
460 void ImmersiveModeControllerAsh::OnMouseEvent(ui::MouseEvent* event) { | 460 void ImmersiveModeControllerAsh::OnMouseEvent(ui::MouseEvent* event) { |
461 if (!enabled_) | 461 if (!enabled_) |
462 return; | 462 return; |
463 | 463 |
| 464 // Counterintuitively, we can still get synthesized mouse moves when |
| 465 // aura::client::CursorClient::IsMouseEventsEnabled() == false. |
| 466 if (event->flags() & ui::EF_IS_SYNTHESIZED) |
| 467 return; |
| 468 |
464 if (event->type() != ui::ET_MOUSE_MOVED && | 469 if (event->type() != ui::ET_MOUSE_MOVED && |
465 event->type() != ui::ET_MOUSE_PRESSED && | 470 event->type() != ui::ET_MOUSE_PRESSED && |
466 event->type() != ui::ET_MOUSE_RELEASED && | 471 event->type() != ui::ET_MOUSE_RELEASED && |
467 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) { | 472 event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) { |
468 return; | 473 return; |
469 } | 474 } |
470 | 475 |
471 // Mouse hover should not initiate revealing the top-of-window views while | 476 // Mouse hover should not initiate revealing the top-of-window views while |
472 // |native_window_| is inactive. | 477 // |native_window_| is inactive. |
473 if (!views::Widget::GetWidgetForNativeWindow(native_window_)->IsActive()) | 478 if (!views::Widget::GetWidgetForNativeWindow(native_window_)->IsActive()) |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 if (!native_window_) | 1092 if (!native_window_) |
1088 return; | 1093 return; |
1089 aura::RootWindow* root_window = native_window_->GetRootWindow(); | 1094 aura::RootWindow* root_window = native_window_->GetRootWindow(); |
1090 if (!root_window) | 1095 if (!root_window) |
1091 return; | 1096 return; |
1092 if (observers_enabled_) | 1097 if (observers_enabled_) |
1093 root_window->AddPreTargetHandler(this); | 1098 root_window->AddPreTargetHandler(this); |
1094 else | 1099 else |
1095 root_window->RemovePreTargetHandler(this); | 1100 root_window->RemovePreTargetHandler(this); |
1096 } | 1101 } |
OLD | NEW |