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

Side by Side Diff: ui/views/controls/menu/activation_change_observer_impl.h

Issue 2155243007: Turn Bookmark Menus Async (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove nested flag Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CONTROLS_MENU_ACTIVATION_CHANGE_OBSERVER_IMPL_H_
6 #define UI_VIEWS_CONTROLS_MENU_ACTIVATION_CHANGE_OBSERVER_IMPL_H_
7
8 #include "ui/aura/window_observer.h"
9 #include "ui/events/event_handler.h"
10 #include "ui/wm/public/activation_change_observer.h"
11
12 namespace aura {
13 class Window;
14 } // namespace aura
15
16 namespace views {
17
18 class MenuController;
19 class Widget;
20
21 // ActivationChangeObserverImpl is used to observe activation changes and close
22 // the menu. Additionally it listens for the root window to be destroyed and
23 // cancel the menu as well.
24 class ActivationChangeObserverImpl
sky 2016/08/01 21:39:45 This name makes sense as an inner class, but for a
jonross 2016/08/02 15:03:25 I've merged them. The differences in how they wer
25 : public aura::client::ActivationChangeObserver,
26 public aura::WindowObserver,
27 public ui::EventHandler {
28 public:
29 ActivationChangeObserverImpl(MenuController* controller, Widget* owner);
30 ~ActivationChangeObserverImpl() override;
31
32 // aura::client:ActivationChangeObserver:
33 void OnWindowActivated(
34 aura::client::ActivationChangeObserver::ActivationReason reason,
35 aura::Window* gained_active,
36 aura::Window* lost_active) override;
37
38 // aura::WindowObserver:
39 void OnWindowDestroying(aura::Window* window) override;
40
41 // ui::EventHandler:
42 void OnCancelMode(ui::CancelModeEvent* event) override;
43
44 private:
45 void Cleanup();
46
47 MenuController* controller_;
48 aura::Window* root_;
49
50 DISALLOW_COPY_AND_ASSIGN(ActivationChangeObserverImpl);
51 };
52
53 } // namespace views
54
55 #endif // UI_VIEWS_CONTROLS_MENU_ACTIVATION_CHANGE_OBSERVER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698