Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / tabs / tab_renderer_data.h
blobe9770591d4a54166f984ff77c854b56eaa174f93
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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_
8 #include "base/process/kill.h"
9 #include "base/strings/string16.h"
10 #include "chrome/browser/ui/tabs/tab_utils.h"
11 #include "chrome/browser/ui/views/chrome_views_export.h"
12 #include "ui/gfx/image/image_skia.h"
13 #include "url/gurl.h"
15 // Wraps the state needed by the renderers.
16 struct CHROME_VIEWS_EXPORT TabRendererData {
17 // Different types of network activity for a tab. The NetworkState of a tab
18 // may be used to alter the UI (e.g. show different kinds of loading
19 // animations).
20 enum NetworkState {
21 NETWORK_STATE_NONE, // no network activity.
22 NETWORK_STATE_WAITING, // waiting for a connection.
23 NETWORK_STATE_LOADING, // connected, transferring data.
26 TabRendererData();
27 ~TabRendererData();
29 // This interprets the crashed status to decide whether or not this
30 // render data represents a tab that is "crashed" (i.e. the render
31 // process died unexpectedly).
32 bool IsCrashed() const {
33 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
34 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED ||
35 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION);
38 // Returns true if the TabRendererData is same as given |data|.
39 bool Equals(const TabRendererData& data);
41 gfx::ImageSkia favicon;
42 NetworkState network_state;
43 base::string16 title;
44 GURL url;
45 bool loading;
46 base::TerminationStatus crashed_status;
47 bool incognito;
48 bool show_icon;
49 bool mini;
50 bool blocked;
51 bool app;
52 TabMediaState media_state;
55 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_RENDERER_DATA_H_