Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / views / tabs / tab_renderer_data.cc
blob9e9260d76a09b7ebe4bf46ea8fe84c32e345e7fb
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 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
7 #include "base/process/kill.h"
9 TabRendererData::TabRendererData()
10 : network_state(NETWORK_STATE_NONE),
11 loading(false),
12 crashed_status(base::TERMINATION_STATUS_STILL_RUNNING),
13 incognito(false),
14 show_icon(true),
15 pinned(false),
16 blocked(false),
17 app(false),
18 media_state(TAB_MEDIA_STATE_NONE) {
21 TabRendererData::~TabRendererData() {}
23 bool TabRendererData::IsCrashed() const {
24 return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
25 #if defined(OS_CHROMEOS)
26 crashed_status ==
27 base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM ||
28 #endif
29 crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED ||
30 crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
31 crashed_status == base::TERMINATION_STATUS_LAUNCH_FAILED);
34 bool TabRendererData::Equals(const TabRendererData& data) {
35 return
36 favicon.BackedBySameObjectAs(data.favicon) &&
37 network_state == data.network_state &&
38 title == data.title &&
39 url == data.url &&
40 loading == data.loading &&
41 crashed_status == data.crashed_status &&
42 incognito == data.incognito &&
43 show_icon == data.show_icon &&
44 pinned == data.pinned &&
45 blocked == data.blocked &&
46 app == data.app &&
47 media_state == data.media_state;