Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 virtual base::TimeTicks GetLastActiveTime() const = 0; | 434 virtual base::TimeTicks GetLastActiveTime() const = 0; |
| 435 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; | 435 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; |
| 436 | 436 |
| 437 // Get the last time that the WebContents was made hidden. | 437 // Get the last time that the WebContents was made hidden. |
| 438 virtual base::TimeTicks GetLastHiddenTime() const = 0; | 438 virtual base::TimeTicks GetLastHiddenTime() const = 0; |
| 439 | 439 |
| 440 // Invoked when the WebContents becomes shown/hidden. | 440 // Invoked when the WebContents becomes shown/hidden. |
| 441 virtual void WasShown() = 0; | 441 virtual void WasShown() = 0; |
| 442 virtual void WasHidden() = 0; | 442 virtual void WasHidden() = 0; |
| 443 | 443 |
| 444 // Whether the WebContents is visible. | |
| 445 virtual bool IsVisible() const = 0; | |
|
Charlie Reis
2017/06/10 00:53:37
I think there's probably a better way to check thi
kenrb
2017/06/12 15:26:22
The call site should be able to use:
navigation_ha
nasko
2017/06/12 23:22:02
Doesn't that distribute implementation logic outsi
Zhen Wang
2017/06/13 23:33:21
This is one option for us to know if a tab is visi
nasko
2017/06/15 20:01:58
I defer to kenrb@ on this one.
kenrb
2017/06/15 20:53:08
Adding that method might make sense here. The only
Zhen Wang
2017/06/19 23:00:12
Right. We will need to know if it is visible befor
| |
| 446 | |
| 444 // Returns true if the before unload and unload listeners need to be | 447 // Returns true if the before unload and unload listeners need to be |
| 445 // fired. The value of this changes over time. For example, if true and the | 448 // fired. The value of this changes over time. For example, if true and the |
| 446 // before unload listener is executed and allows the user to exit, then this | 449 // before unload listener is executed and allows the user to exit, then this |
| 447 // returns false. | 450 // returns false. |
| 448 virtual bool NeedToFireBeforeUnload() = 0; | 451 virtual bool NeedToFireBeforeUnload() = 0; |
| 449 | 452 |
| 450 // Runs the beforeunload handler for the main frame. See also ClosePage and | 453 // Runs the beforeunload handler for the main frame. See also ClosePage and |
| 451 // SwapOut in RenderViewHost, which run the unload handler. | 454 // SwapOut in RenderViewHost, which run the unload handler. |
| 452 // | 455 // |
| 453 // TODO(creis): We should run the beforeunload handler for every frame that | 456 // TODO(creis): We should run the beforeunload handler for every frame that |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 822 | 825 |
| 823 private: | 826 private: |
| 824 // This interface should only be implemented inside content. | 827 // This interface should only be implemented inside content. |
| 825 friend class WebContentsImpl; | 828 friend class WebContentsImpl; |
| 826 WebContents() {} | 829 WebContents() {} |
| 827 }; | 830 }; |
| 828 | 831 |
| 829 } // namespace content | 832 } // namespace content |
| 830 | 833 |
| 831 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 834 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |