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

Side by Side Diff: ui/aura/window.h

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_AURA_WINDOW_H_ 5 #ifndef UI_AURA_WINDOW_H_
6 #define UI_AURA_WINDOW_H_ 6 #define UI_AURA_WINDOW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void set_host(WindowTreeHost* host) { host_ = host; } 129 void set_host(WindowTreeHost* host) { host_ = host; }
130 bool IsRootWindow() const { return !!host_; } 130 bool IsRootWindow() const { return !!host_; }
131 131
132 // The Window does not own this object. 132 // The Window does not own this object.
133 void set_user_data(void* user_data) { user_data_ = user_data; } 133 void set_user_data(void* user_data) { user_data_ = user_data; }
134 void* user_data() const { return user_data_; } 134 void* user_data() const { return user_data_; }
135 135
136 // Changes the visibility of the window. 136 // Changes the visibility of the window.
137 void Show(); 137 void Show();
138 void Hide(); 138 void Hide();
139 #if defined(OS_LINUX)
140 void SetPageVisibility(bool visibility);
141 #endif
139 // Returns true if this window and all its ancestors are visible. 142 // Returns true if this window and all its ancestors are visible.
140 bool IsVisible() const; 143 bool IsVisible() const;
141 // Returns the visibility requested by this window. IsVisible() takes into 144 // Returns the visibility requested by this window. IsVisible() takes into
142 // account the visibility of the layer and ancestors, where as this tracks 145 // account the visibility of the layer and ancestors, where as this tracks
143 // whether Show() without a Hide() has been invoked. 146 // whether Show() without a Hide() has been invoked.
144 bool TargetVisibility() const { return visible_; } 147 bool TargetVisibility() const { return visible_; }
145 148
146 // Returns the window's bounds in root window's coordinates. 149 // Returns the window's bounds in root window's coordinates.
147 gfx::Rect GetBoundsInRootWindow() const; 150 gfx::Rect GetBoundsInRootWindow() const;
148 151
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 const WindowObserver::HierarchyChangeParams& params); 438 const WindowObserver::HierarchyChangeParams& params);
436 // Notifies this window and its parent hierarchy. 439 // Notifies this window and its parent hierarchy.
437 void NotifyWindowHierarchyChangeUp( 440 void NotifyWindowHierarchyChangeUp(
438 const WindowObserver::HierarchyChangeParams& params); 441 const WindowObserver::HierarchyChangeParams& params);
439 // Notifies this window's observers. 442 // Notifies this window's observers.
440 void NotifyWindowHierarchyChangeAtReceiver( 443 void NotifyWindowHierarchyChangeAtReceiver(
441 const WindowObserver::HierarchyChangeParams& params); 444 const WindowObserver::HierarchyChangeParams& params);
442 445
443 // Methods implementing visibility change notifications. See WindowObserver 446 // Methods implementing visibility change notifications. See WindowObserver
444 // for more details. 447 // for more details.
445 void NotifyWindowVisibilityChanged(aura::Window* target, bool visible); 448 void NotifyWindowVisibilityChanged(aura::Window* target, bool visible,
449 bool content_visible);
446 // Notifies this window's observers. Returns false if |this| was deleted 450 // Notifies this window's observers. Returns false if |this| was deleted
447 // during the call (by an observer), otherwise true. 451 // during the call (by an observer), otherwise true.
448 bool NotifyWindowVisibilityChangedAtReceiver(aura::Window* target, 452 bool NotifyWindowVisibilityChangedAtReceiver(aura::Window* target,
449 bool visible); 453 bool visible,
454 bool content_visible);
450 // Notifies this window and its child hierarchy. Returns false if 455 // Notifies this window and its child hierarchy. Returns false if
451 // |this| was deleted during the call (by an observer), otherwise 456 // |this| was deleted during the call (by an observer), otherwise
452 // true. 457 // true.
453 bool NotifyWindowVisibilityChangedDown(aura::Window* target, bool visible); 458 bool NotifyWindowVisibilityChangedDown(aura::Window* target,
459 bool visible,
460 bool content_visible);
454 // Notifies this window and its parent hierarchy. 461 // Notifies this window and its parent hierarchy.
455 void NotifyWindowVisibilityChangedUp(aura::Window* target, bool visible); 462 void NotifyWindowVisibilityChangedUp(aura::Window* target, bool visible);
456 463
457 // Notifies this window and its child hierarchy of a transform applied to 464 // Notifies this window and its child hierarchy of a transform applied to
458 // |source|. 465 // |source|.
459 void NotifyAncestorWindowTransformed(Window* source); 466 void NotifyAncestorWindowTransformed(Window* source);
460 467
461 // Invoked when the bounds of the window changes. This may be invoked directly 468 // Invoked when the bounds of the window changes. This may be invoked directly
462 // by us, or from the closure returned by PrepareForLayerBoundsChange() after 469 // by us, or from the closure returned by PrepareForLayerBoundsChange() after
463 // the bounds of the layer has changed. |old_bounds| is the previous bounds. 470 // the bounds of the layer has changed. |old_bounds| is the previous bounds.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 }; 553 };
547 554
548 std::map<const void*, Value> prop_map_; 555 std::map<const void*, Value> prop_map_;
549 556
550 DISALLOW_COPY_AND_ASSIGN(Window); 557 DISALLOW_COPY_AND_ASSIGN(Window);
551 }; 558 };
552 559
553 } // namespace aura 560 } // namespace aura
554 561
555 #endif // UI_AURA_WINDOW_H_ 562 #endif // UI_AURA_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698