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

Side by Side Diff: components/mus/public/cpp/window_manager_delegate.h

Issue 1656123002: Moves accelerator registration to WindowManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mandoline Created 4 years, 10 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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h"
13 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "components/mus/public/interfaces/input_event_matcher.mojom.h"
16 #include "components/mus/public/interfaces/input_events.mojom.h"
14 #include "components/mus/public/interfaces/window_manager_constants.mojom.h" 17 #include "components/mus/public/interfaces/window_manager_constants.mojom.h"
15 18
16 namespace gfx { 19 namespace gfx {
17 class Rect; 20 class Rect;
18 } 21 }
19 22
20 namespace mus { 23 namespace mus {
21 24
22 class Window; 25 class Window;
23 26
27 // See the mojom with the same name for details on the functions in this
28 // interface.
24 class WindowManagerClient { 29 class WindowManagerClient {
25 public: 30 public:
26 virtual void SetFrameDecorationValues( 31 virtual void SetFrameDecorationValues(
27 mojom::FrameDecorationValuesPtr values) = 0; 32 mojom::FrameDecorationValuesPtr values) = 0;
28 33
34 virtual void AddAccelerator(uint32_t id,
35 mojom::EventMatcherPtr event_matcher,
36 const base::Callback<void(bool)>& callback) = 0;
37 virtual void RemoveAccelerator(uint32_t id) = 0;
38
29 protected: 39 protected:
30 virtual ~WindowManagerClient() {} 40 virtual ~WindowManagerClient() {}
31 }; 41 };
32 42
33 // Used by clients implementing a window manager. 43 // Used by clients implementing a window manager.
34 // TODO(sky): this should be called WindowManager, but that's rather confusing 44 // TODO(sky): this should be called WindowManager, but that's rather confusing
35 // currently. 45 // currently.
36 class WindowManagerDelegate { 46 class WindowManagerDelegate {
37 public: 47 public:
38 // Called once to give the delegate access to functions only exposed to 48 // Called once to give the delegate access to functions only exposed to
(...skipping 16 matching lines...) Expand all
55 65
56 // A client has requested a new top level window. The delegate should create 66 // A client has requested a new top level window. The delegate should create
57 // and parent the window appropriately and return it. |properties| is the 67 // and parent the window appropriately and return it. |properties| is the
58 // supplied properties from the client requesting the new window. The 68 // supplied properties from the client requesting the new window. The
59 // delegate may modify |properties| before calling NewWindow(), but the 69 // delegate may modify |properties| before calling NewWindow(), but the
60 // delegate does *not* own |properties|, they are valid only for the life 70 // delegate does *not* own |properties|, they are valid only for the life
61 // of OnWmCreateTopLevelWindow(). 71 // of OnWmCreateTopLevelWindow().
62 virtual Window* OnWmCreateTopLevelWindow( 72 virtual Window* OnWmCreateTopLevelWindow(
63 std::map<std::string, std::vector<uint8_t>>* properties) = 0; 73 std::map<std::string, std::vector<uint8_t>>* properties) = 0;
64 74
75 virtual void OnAccelerator(uint32_t id, mus::mojom::EventPtr event) = 0;
76
65 protected: 77 protected:
66 virtual ~WindowManagerDelegate() {} 78 virtual ~WindowManagerDelegate() {}
67 }; 79 };
68 80
69 } // namespace mus 81 } // namespace mus
70 82
71 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_ 83 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/tests/window_server_test_base.cc ('k') | components/mus/public/interfaces/window_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698