| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/menu/menu_message_loop_aura.h" | 5 #include "ui/views/controls/menu/menu_message_loop_aura.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 ActivationChangeObserverImpl(MenuController* controller, aura::Window* root) | 53 ActivationChangeObserverImpl(MenuController* controller, aura::Window* root) |
| 54 : controller_(controller), root_(root) { | 54 : controller_(controller), root_(root) { |
| 55 aura::client::GetActivationClient(root_)->AddObserver(this); | 55 aura::client::GetActivationClient(root_)->AddObserver(this); |
| 56 root_->AddObserver(this); | 56 root_->AddObserver(this); |
| 57 root_->AddPreTargetHandler(this); | 57 root_->AddPreTargetHandler(this); |
| 58 } | 58 } |
| 59 | 59 |
| 60 ~ActivationChangeObserverImpl() override { Cleanup(); } | 60 ~ActivationChangeObserverImpl() override { Cleanup(); } |
| 61 | 61 |
| 62 // aura::client::ActivationChangeObserver: | 62 // aura::client::ActivationChangeObserver: |
| 63 void OnWindowActivated(aura::Window* gained_active, | 63 void OnWindowActivated( |
| 64 aura::Window* lost_active) override { | 64 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 65 aura::Window* gained_active, |
| 66 aura::Window* lost_active) override { |
| 65 if (!controller_->drag_in_progress()) | 67 if (!controller_->drag_in_progress()) |
| 66 controller_->CancelAll(); | 68 controller_->CancelAll(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 // aura::WindowObserver: | 71 // aura::WindowObserver: |
| 70 void OnWindowDestroying(aura::Window* window) override { Cleanup(); } | 72 void OnWindowDestroying(aura::Window* window) override { Cleanup(); } |
| 71 | 73 |
| 72 // ui::EventHandler: | 74 // ui::EventHandler: |
| 73 void OnCancelMode(ui::CancelModeEvent* event) override { | 75 void OnCancelMode(ui::CancelModeEvent* event) override { |
| 74 controller_->CancelAll(); | 76 controller_->CancelAll(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 if (ui::PlatformEventSource::GetInstance()) | 192 if (ui::PlatformEventSource::GetInstance()) |
| 191 ui::PlatformEventSource::GetInstance()->StopCurrentEventStream(); | 193 ui::PlatformEventSource::GetInstance()->StopCurrentEventStream(); |
| 192 #endif | 194 #endif |
| 193 } | 195 } |
| 194 | 196 |
| 195 void MenuMessageLoopAura::ClearOwner() { | 197 void MenuMessageLoopAura::ClearOwner() { |
| 196 owner_ = NULL; | 198 owner_ = NULL; |
| 197 } | 199 } |
| 198 | 200 |
| 199 } // namespace views | 201 } // namespace views |
| OLD | NEW |