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

Side by Side Diff: ui/views/mus/window_manager_connection.cc

Issue 2057793002: Reorganize event mojom files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos in comments. Created 4 years, 6 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
« no previous file with comments | « ui/events/mojo/traits_test_service.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ui/views/mus/window_manager_connection.h" 5 #include "ui/views/mus/window_manager_connection.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) { 83 void WindowManagerConnection::AddPointerWatcher(PointerWatcher* watcher) {
84 bool had_watcher = HasPointerWatcher(); 84 bool had_watcher = HasPointerWatcher();
85 pointer_watchers_.AddObserver(watcher); 85 pointer_watchers_.AddObserver(watcher);
86 if (!had_watcher) { 86 if (!had_watcher) {
87 // Start a watcher for pointer down. 87 // Start a watcher for pointer down.
88 // TODO(jamescook): Extend event observers to handle multiple event types. 88 // TODO(jamescook): Extend event observers to handle multiple event types.
89 mus::mojom::EventMatcherPtr matcher = mus::mojom::EventMatcher::New(); 89 mus::mojom::EventMatcherPtr matcher = mus::mojom::EventMatcher::New();
90 matcher->type_matcher = mus::mojom::EventTypeMatcher::New(); 90 matcher->type_matcher = mus::mojom::EventTypeMatcher::New();
91 matcher->type_matcher->type = mus::mojom::EventType::POINTER_DOWN; 91 matcher->type_matcher->type = ui::mojom::EventType::POINTER_DOWN;
92 client_->SetEventObserver(std::move(matcher)); 92 client_->SetEventObserver(std::move(matcher));
93 } 93 }
94 } 94 }
95 95
96 void WindowManagerConnection::RemovePointerWatcher(PointerWatcher* watcher) { 96 void WindowManagerConnection::RemovePointerWatcher(PointerWatcher* watcher) {
97 pointer_watchers_.RemoveObserver(watcher); 97 pointer_watchers_.RemoveObserver(watcher);
98 if (!HasPointerWatcher()) { 98 if (!HasPointerWatcher()) {
99 // Last PointerWatcher removed, stop the event observer. 99 // Last PointerWatcher removed, stop the event observer.
100 client_->SetEventObserver(nullptr); 100 client_->SetEventObserver(nullptr);
101 } 101 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() { 188 void WindowManagerConnection::OnWindowManagerFrameValuesChanged() {
189 if (client_) 189 if (client_)
190 NativeWidgetMus::NotifyFrameChanged(client_.get()); 190 NativeWidgetMus::NotifyFrameChanged(client_.get());
191 } 191 }
192 192
193 gfx::Point WindowManagerConnection::GetCursorScreenPoint() { 193 gfx::Point WindowManagerConnection::GetCursorScreenPoint() {
194 return client_->GetCursorScreenPoint(); 194 return client_->GetCursorScreenPoint();
195 } 195 }
196 196
197 } // namespace views 197 } // namespace views
OLDNEW
« no previous file with comments | « ui/events/mojo/traits_test_service.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698