Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.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 TabRendererData() | 24 TabRendererData() |
| 25 : network_state(NETWORK_STATE_NONE), | 25 : network_state(NETWORK_STATE_NONE), |
| 26 common_prefix_length(0), | |
| 26 loading(false), | 27 loading(false), |
| 27 crashed_status(base::TERMINATION_STATUS_STILL_RUNNING), | 28 crashed_status(base::TERMINATION_STATUS_STILL_RUNNING), |
| 28 off_the_record(false), | 29 off_the_record(false), |
| 29 show_icon(true), | 30 show_icon(true), |
| 30 mini(false), | 31 mini(false), |
| 31 blocked(false), | 32 blocked(false), |
| 32 app(false) { | 33 app(false) { |
| 33 } | 34 } |
| 34 | 35 |
| 35 // This interprets the crashed status to decide whether or not this | 36 // This interprets the crashed status to decide whether or not this |
| 36 // render data represents a tab that is "crashed" (i.e. the render | 37 // render data represents a tab that is "crashed" (i.e. the render |
| 37 // process died unexpectedly). | 38 // process died unexpectedly). |
| 38 bool IsCrashed() const { | 39 bool IsCrashed() const { |
| 39 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || | 40 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED || |
| 40 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED || | 41 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED || |
| 41 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION); | 42 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION); |
| 42 } | 43 } |
| 43 | 44 |
| 44 SkBitmap favicon; | 45 SkBitmap favicon; |
| 45 NetworkState network_state; | 46 NetworkState network_state; |
| 46 string16 title; | 47 string16 title; |
| 48 // Identifies the number of chars at the beginning of the string | |
| 49 // that are common to other tab titles. | |
| 50 int32 common_prefix_length; | |
|
sky
2011/02/25 17:02:07
size_t
MAD
2011/02/25 20:09:13
D'Ho!... Done... :-)
| |
| 47 bool loading; | 51 bool loading; |
| 48 base::TerminationStatus crashed_status; | 52 base::TerminationStatus crashed_status; |
| 49 bool off_the_record; | 53 bool off_the_record; |
| 50 bool show_icon; | 54 bool show_icon; |
| 51 bool mini; | 55 bool mini; |
| 52 bool blocked; | 56 bool blocked; |
| 53 bool app; | 57 bool app; |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_ |
| OLD | NEW |