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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 435 virtual base::TimeTicks GetLastActiveTime() const = 0; | 435 virtual base::TimeTicks GetLastActiveTime() const = 0; |
| 436 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; | 436 virtual void SetLastActiveTime(base::TimeTicks last_active_time) = 0; |
| 437 | 437 |
| 438 // Get the last time that the WebContents was made hidden. | 438 // Get the last time that the WebContents was made hidden. |
| 439 virtual base::TimeTicks GetLastHiddenTime() const = 0; | 439 virtual base::TimeTicks GetLastHiddenTime() const = 0; |
| 440 | 440 |
| 441 // Invoked when the WebContents becomes shown/hidden. | 441 // Invoked when the WebContents becomes shown/hidden. |
| 442 virtual void WasShown() = 0; | 442 virtual void WasShown() = 0; |
| 443 virtual void WasHidden() = 0; | 443 virtual void WasHidden() = 0; |
| 444 | 444 |
| 445 // Whether the WebContents is visible. | |
| 446 virtual bool IsVisible() const = 0; | |
|
Charlie Reis
2017/07/06 23:50:31
I still find this confusing vs RWHV::IsShowing(),
Zhen Wang
2017/07/07 18:06:39
Added comments now. Ken, can you double check if t
| |
| 447 | |
| 445 // Returns true if the before unload and unload listeners need to be | 448 // Returns true if the before unload and unload listeners need to be |
| 446 // fired. The value of this changes over time. For example, if true and the | 449 // fired. The value of this changes over time. For example, if true and the |
| 447 // before unload listener is executed and allows the user to exit, then this | 450 // before unload listener is executed and allows the user to exit, then this |
| 448 // returns false. | 451 // returns false. |
| 449 virtual bool NeedToFireBeforeUnload() = 0; | 452 virtual bool NeedToFireBeforeUnload() = 0; |
| 450 | 453 |
| 451 // Runs the beforeunload handler for the main frame. See also ClosePage and | 454 // Runs the beforeunload handler for the main frame. See also ClosePage and |
| 452 // SwapOut in RenderViewHost, which run the unload handler. | 455 // SwapOut in RenderViewHost, which run the unload handler. |
| 453 // | 456 // |
| 454 // TODO(creis): We should run the beforeunload handler for every frame that | 457 // TODO(creis): We should run the beforeunload handler for every frame that |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 838 | 841 |
| 839 private: | 842 private: |
| 840 // This interface should only be implemented inside content. | 843 // This interface should only be implemented inside content. |
| 841 friend class WebContentsImpl; | 844 friend class WebContentsImpl; |
| 842 WebContents() {} | 845 WebContents() {} |
| 843 }; | 846 }; |
| 844 | 847 |
| 845 } // namespace content | 848 } // namespace content |
| 846 | 849 |
| 847 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 850 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |