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

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

Issue 1991973003: mash: Preliminary support for widget hit test masks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skip underlay Created 4 years, 7 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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_
6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const gfx::Insets& client_area() const { return client_area_; } 79 const gfx::Insets& client_area() const { return client_area_; }
80 const std::vector<gfx::Rect>& additional_client_areas() { 80 const std::vector<gfx::Rect>& additional_client_areas() {
81 return additional_client_areas_; 81 return additional_client_areas_;
82 } 82 }
83 void SetClientArea(const gfx::Insets& new_client_area) { 83 void SetClientArea(const gfx::Insets& new_client_area) {
84 SetClientArea(new_client_area, std::vector<gfx::Rect>()); 84 SetClientArea(new_client_area, std::vector<gfx::Rect>());
85 } 85 }
86 void SetClientArea(const gfx::Insets& new_client_area, 86 void SetClientArea(const gfx::Insets& new_client_area,
87 const std::vector<gfx::Rect>& additional_client_areas); 87 const std::vector<gfx::Rect>& additional_client_areas);
88 88
89 // Mouse events outside the hit test mask do not hit the window. Returns null
90 // if there is no mask.
91 const gfx::Rect* hit_test_mask() const { return hit_test_mask_.get(); }
92 void SetHitTestMask(const gfx::Rect& mask_rect);
93 void ClearHitTestMask();
94
89 // Visibility (also see IsDrawn()). When created windows are hidden. 95 // Visibility (also see IsDrawn()). When created windows are hidden.
90 bool visible() const { return visible_; } 96 bool visible() const { return visible_; }
91 void SetVisible(bool value); 97 void SetVisible(bool value);
92 98
93 float opacity() const { return opacity_; } 99 float opacity() const { return opacity_; }
94 void SetOpacity(float opacity); 100 void SetOpacity(float opacity);
95 101
96 // Cursors 102 // Cursors
97 mojom::Cursor predefined_cursor() const { return cursor_id_; } 103 mojom::Cursor predefined_cursor() const { return cursor_id_; }
98 void SetPredefinedCursor(mus::mojom::Cursor cursor_id); 104 void SetPredefinedCursor(mus::mojom::Cursor cursor_id);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 Children transient_children_; 320 Children transient_children_;
315 321
316 bool is_modal_; 322 bool is_modal_;
317 323
318 base::ObserverList<WindowObserver> observers_; 324 base::ObserverList<WindowObserver> observers_;
319 InputEventHandler* input_event_handler_; 325 InputEventHandler* input_event_handler_;
320 326
321 gfx::Rect bounds_; 327 gfx::Rect bounds_;
322 gfx::Insets client_area_; 328 gfx::Insets client_area_;
323 std::vector<gfx::Rect> additional_client_areas_; 329 std::vector<gfx::Rect> additional_client_areas_;
330 std::unique_ptr<gfx::Rect> hit_test_mask_;
324 331
325 mojom::ViewportMetricsPtr viewport_metrics_; 332 mojom::ViewportMetricsPtr viewport_metrics_;
326 333
327 bool visible_; 334 bool visible_;
328 float opacity_; 335 float opacity_;
329 336
330 mojom::Cursor cursor_id_; 337 mojom::Cursor cursor_id_;
331 338
332 SharedProperties properties_; 339 SharedProperties properties_;
333 340
(...skipping 11 matching lines...) Expand all
345 }; 352 };
346 353
347 std::map<const void*, Value> prop_map_; 354 std::map<const void*, Value> prop_map_;
348 355
349 DISALLOW_COPY_AND_ASSIGN(Window); 356 DISALLOW_COPY_AND_ASSIGN(Window);
350 }; 357 };
351 358
352 } // namespace mus 359 } // namespace mus
353 360
354 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_ 361 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698