OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_RENDER_PROCESS_VISIBILITY_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_RENDER_PROCESS_VISIBILITY_MANAGER_H_ |
| 7 |
| 8 #include "base/memory/singleton.h" |
| 9 #include "base/observer_list.h" |
| 10 #include "content/common/content_export.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class CONTENT_EXPORT RenderProcessVisibilityObserver { |
| 15 public: |
| 16 virtual void RenderProcessVisibilityChanged(bool visible) = 0; |
| 17 }; |
| 18 |
| 19 class CONTENT_EXPORT RenderProcessVisibilityManager { |
| 20 public: |
| 21 static RenderProcessVisibilityManager* GetInstance(); |
| 22 |
| 23 void WidgetVisibilityChanged(bool visible); |
| 24 |
| 25 void AddObserver(RenderProcessVisibilityObserver* observer); |
| 26 void RemoveObserver(RenderProcessVisibilityObserver* observer); |
| 27 |
| 28 private: |
| 29 friend struct DefaultSingletonTraits<RenderProcessVisibilityManager>; |
| 30 |
| 31 RenderProcessVisibilityManager(); |
| 32 ~RenderProcessVisibilityManager(); |
| 33 |
| 34 int num_visible_render_widgets_; |
| 35 ObserverList<RenderProcessVisibilityObserver> observers_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(RenderProcessVisibilityManager); |
| 38 }; |
| 39 |
| 40 } // namespace content |
| 41 |
| 42 #endif // CONTENT_RENDERER_RENDER_PROCESS_VISIBILITY_MANAGER_H_ |
OLD | NEW |