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 CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ |
7 | 7 |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "ui/gfx/image/image_skia.h" | 11 #include "ui/gfx/image/image_skia.h" |
12 | 12 |
13 // Wraps the state needed by the renderers. | 13 // Wraps the state needed by the renderers. |
14 struct TabRendererData { | 14 struct TabRendererData { |
15 // Different types of network activity for a tab. The NetworkState of a tab | 15 // Different types of network activity for a tab. The NetworkState of a tab |
16 // may be used to alter the UI (e.g. show different kinds of loading | 16 // may be used to alter the UI (e.g. show different kinds of loading |
17 // animations). | 17 // animations). |
18 enum NetworkState { | 18 enum NetworkState { |
19 NETWORK_STATE_NONE, // no network activity. | 19 NETWORK_STATE_NONE, // no network activity. |
20 NETWORK_STATE_WAITING, // waiting for a connection. | 20 NETWORK_STATE_WAITING, // waiting for a connection. |
21 NETWORK_STATE_LOADING, // connected, transferring data. | 21 NETWORK_STATE_LOADING, // connected, transferring data. |
22 }; | 22 }; |
23 | 23 |
| 24 // Capture state of this tab. If a WebRTC media stream is active, then it is |
| 25 // recording. If tab capturing is active then it is projecting. |
| 26 enum CaptureState { |
| 27 CAPTURE_STATE_NONE, |
| 28 CAPTURE_STATE_RECORDING, |
| 29 CAPTURE_STATE_PROJECTING |
| 30 }; |
| 31 |
24 TabRendererData(); | 32 TabRendererData(); |
25 ~TabRendererData(); | 33 ~TabRendererData(); |
26 | 34 |
27 // This interprets the crashed status to decide whether or not this | 35 // This interprets the crashed status to decide whether or not this |
28 // render data represents a tab that is "crashed" (i.e. the render | 36 // render data represents a tab that is "crashed" (i.e. the render |
29 // process died unexpectedly). | 37 // process died unexpectedly). |
30 bool IsCrashed() const { | 38 bool IsCrashed() const { |
31 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || | 39 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
32 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED || | 40 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED || |
33 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION); | 41 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION); |
34 } | 42 } |
35 | 43 |
36 // Returns true if the TabRendererData is same as given |data|. | 44 // Returns true if the TabRendererData is same as given |data|. |
37 bool Equals(const TabRendererData& data); | 45 bool Equals(const TabRendererData& data); |
38 | 46 |
39 gfx::ImageSkia favicon; | 47 gfx::ImageSkia favicon; |
40 NetworkState network_state; | 48 NetworkState network_state; |
41 string16 title; | 49 string16 title; |
42 GURL url; | 50 GURL url; |
43 bool loading; | 51 bool loading; |
44 base::TerminationStatus crashed_status; | 52 base::TerminationStatus crashed_status; |
45 bool incognito; | 53 bool incognito; |
46 bool show_icon; | 54 bool show_icon; |
47 bool mini; | 55 bool mini; |
48 bool blocked; | 56 bool blocked; |
49 bool app; | 57 bool app; |
50 bool recording; | 58 CaptureState capture_state; |
51 }; | 59 }; |
52 | 60 |
53 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ | 61 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ |
OLD | NEW |