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

Side by Side Diff: ui/views/mus/platform_window_mus.h

Issue 1891233006: mus: Fix handled status in UI event ack, add MessageLoop::NestingObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eventresult
Patch Set: Created 4 years, 8 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ 5 #ifndef UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_
6 #define UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ 6 #define UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/message_loop/message_loop.h"
14 #include "components/mus/public/cpp/input_event_handler.h" 15 #include "components/mus/public/cpp/input_event_handler.h"
15 #include "components/mus/public/cpp/window_observer.h" 16 #include "components/mus/public/cpp/window_observer.h"
16 #include "ui/platform_window/platform_window.h" 17 #include "ui/platform_window/platform_window.h"
17 #include "ui/views/mus/mus_export.h" 18 #include "ui/views/mus/mus_export.h"
18 19
19 namespace bitmap_uploader { 20 namespace bitmap_uploader {
20 class BitmapUploader; 21 class BitmapUploader;
21 } 22 }
22 23
23 namespace shell { 24 namespace shell {
24 class Connector; 25 class Connector;
25 } 26 }
26 27
27 namespace ui { 28 namespace ui {
28 class Event; 29 class Event;
29 class ViewProp; 30 class ViewProp;
30 } 31 }
31 32
32 namespace views { 33 namespace views {
33 34
34 class VIEWS_MUS_EXPORT PlatformWindowMus 35 class VIEWS_MUS_EXPORT PlatformWindowMus
35 : public NON_EXPORTED_BASE(ui::PlatformWindow), 36 : public NON_EXPORTED_BASE(ui::PlatformWindow),
36 public mus::WindowObserver, 37 public mus::WindowObserver,
37 public NON_EXPORTED_BASE(mus::InputEventHandler) { 38 public NON_EXPORTED_BASE(mus::InputEventHandler),
39 public base::MessageLoop::NestingObserver {
38 public: 40 public:
39 PlatformWindowMus(ui::PlatformWindowDelegate* delegate, 41 PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
40 shell::Connector* connector, 42 shell::Connector* connector,
41 mus::Window* mus_window); 43 mus::Window* mus_window);
42 ~PlatformWindowMus() override; 44 ~PlatformWindowMus() override;
43 45
44 void Activate(); 46 void Activate();
45 47
46 void SetCursorById(mus::mojom::Cursor cursor); 48 void SetCursorById(mus::mojom::Cursor cursor);
47 49
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const std::vector<uint8_t>* new_data) override; 84 const std::vector<uint8_t>* new_data) override;
83 void OnRequestClose(mus::Window* window) override; 85 void OnRequestClose(mus::Window* window) override;
84 86
85 // mus::InputEventHandler: 87 // mus::InputEventHandler:
86 void OnWindowInputEvent( 88 void OnWindowInputEvent(
87 mus::Window* view, 89 mus::Window* view,
88 const ui::Event& event, 90 const ui::Event& event,
89 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>* 91 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>*
90 ack_callback) override; 92 ack_callback) override;
91 93
94 // base::MessageLoop::NestingObserver:
95 void OnBeginNestedMessageLoop() override;
96
92 ui::PlatformWindowDelegate* delegate_; 97 ui::PlatformWindowDelegate* delegate_;
93 mus::Window* mus_window_; 98 mus::Window* mus_window_;
94 mus::mojom::ShowState show_state_; 99 mus::mojom::ShowState show_state_;
95 mus::mojom::Cursor last_cursor_; 100 mus::mojom::Cursor last_cursor_;
96 101
102 std::unique_ptr<base::Callback<void(mus::mojom::EventResult)>>
103 event_ack_callback_;
104
97 // True if OnWindowDestroyed() has been received. 105 // True if OnWindowDestroyed() has been received.
98 bool mus_window_destroyed_; 106 bool mus_window_destroyed_;
99 107
100 std::unique_ptr<bitmap_uploader::BitmapUploader> bitmap_uploader_; 108 std::unique_ptr<bitmap_uploader::BitmapUploader> bitmap_uploader_;
101 std::unique_ptr<ui::ViewProp> prop_; 109 std::unique_ptr<ui::ViewProp> prop_;
102 #ifndef NDEBUG 110 #ifndef NDEBUG
103 std::unique_ptr<base::WeakPtrFactory<PlatformWindowMus>> weak_factory_; 111 std::unique_ptr<base::WeakPtrFactory<PlatformWindowMus>> weak_factory_;
104 #endif 112 #endif
105 113
106 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus); 114 DISALLOW_COPY_AND_ASSIGN(PlatformWindowMus);
107 }; 115 };
108 116
109 } // namespace views 117 } // namespace views
110 118
111 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_ 119 #endif // UI_VIEWS_MUS_PLATFORM_WINDOW_MUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698