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

Side by Side Diff: services/ui/public/cpp/window.h

Issue 2118383002: mus: Disregard windows that explicitly set can_accept_events to be false when sending events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Early return Created 4 years, 5 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 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 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_H_
6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_ 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 bool HasCapture() const; 203 bool HasCapture() const;
204 void SetCapture(); 204 void SetCapture();
205 void ReleaseCapture(); 205 void ReleaseCapture();
206 206
207 // Focus. See WindowTreeClient::ClearFocus() to reset focus. 207 // Focus. See WindowTreeClient::ClearFocus() to reset focus.
208 void SetFocus(); 208 void SetFocus();
209 bool HasFocus() const; 209 bool HasFocus() const;
210 void SetCanFocus(bool can_focus); 210 void SetCanFocus(bool can_focus);
211 211
212 // Sets whether this window accepts events.
213 void SetCanAcceptEvents(bool can_accept_events);
214
212 // Embedding. See window_tree.mojom for details. 215 // Embedding. See window_tree.mojom for details.
213 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0); 216 void Embed(ui::mojom::WindowTreeClientPtr client, uint32_t flags = 0);
214 217
215 // NOTE: callback is run synchronously if Embed() is not allowed on this 218 // NOTE: callback is run synchronously if Embed() is not allowed on this
216 // Window. 219 // Window.
217 void Embed(ui::mojom::WindowTreeClientPtr client, 220 void Embed(ui::mojom::WindowTreeClientPtr client,
218 const EmbedCallback& callback, 221 const EmbedCallback& callback,
219 uint32_t flags = 0); 222 uint32_t flags = 0);
220 223
221 // TODO(sky): this API is only applicable to the WindowManager. Move it 224 // TODO(sky): this API is only applicable to the WindowManager. Move it
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 335
333 gfx::Rect bounds_; 336 gfx::Rect bounds_;
334 gfx::Insets client_area_; 337 gfx::Insets client_area_;
335 std::vector<gfx::Rect> additional_client_areas_; 338 std::vector<gfx::Rect> additional_client_areas_;
336 std::unique_ptr<gfx::Rect> hit_test_mask_; 339 std::unique_ptr<gfx::Rect> hit_test_mask_;
337 340
338 bool visible_; 341 bool visible_;
339 float opacity_; 342 float opacity_;
340 int64_t display_id_; 343 int64_t display_id_;
341 344
345 // Whether this window can accept events.
346 // Only call SetCanAcceptEvents if the new setting is different from
msw 2016/07/12 22:07:23 nit: move this sentence up to |SetCanAcceptEvents|
riajiang 2016/07/13 00:01:45 Done.
347 // the current one. Initialize it to be true since server window will
msw 2016/07/12 22:07:23 nit: "Initialized to true to match ServerWindow".
riajiang 2016/07/13 00:01:45 Done.
348 // also initialize can_accept_events_ to be true.
msw 2016/07/12 22:07:23 nit: |can_accept_events_| (if you keep this)
349 bool can_accept_events_ = true;
350
342 mojom::Cursor cursor_id_; 351 mojom::Cursor cursor_id_;
343 352
344 SharedProperties properties_; 353 SharedProperties properties_;
345 354
346 // Drawn state of our parent. This is only meaningful for root Windows, in 355 // Drawn state of our parent. This is only meaningful for root Windows, in
347 // which the parent Window isn't exposed to the client. 356 // which the parent Window isn't exposed to the client.
348 bool parent_drawn_; 357 bool parent_drawn_;
349 358
350 // Value struct to keep the name and deallocator for this property. 359 // Value struct to keep the name and deallocator for this property.
351 // Key cannot be used for this purpose because it can be char* or 360 // Key cannot be used for this purpose because it can be char* or
352 // WindowProperty<>. 361 // WindowProperty<>.
353 struct Value { 362 struct Value {
354 const char* name; 363 const char* name;
355 int64_t value; 364 int64_t value;
356 PropertyDeallocator deallocator; 365 PropertyDeallocator deallocator;
357 }; 366 };
358 367
359 std::map<const void*, Value> prop_map_; 368 std::map<const void*, Value> prop_map_;
360 369
361 DISALLOW_COPY_AND_ASSIGN(Window); 370 DISALLOW_COPY_AND_ASSIGN(Window);
362 }; 371 };
363 372
364 } // namespace ui 373 } // namespace ui
365 374
366 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_ 375 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698