[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / sad_tab_helper.h
blobf61da72e28b0b660c4758e0f8708596591534d0c
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_SAD_TAB_HELPER_H_
6 #define CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/web_contents_observer.h"
12 #include "content/public/browser/web_contents_user_data.h"
14 namespace chrome {
15 class SadTab;
18 // Per-tab class to manage sad tab views.
19 class SadTabHelper : public content::WebContentsObserver,
20 public content::WebContentsUserData<SadTabHelper> {
21 public:
22 virtual ~SadTabHelper();
24 chrome::SadTab* sad_tab() { return sad_tab_.get(); }
26 private:
27 friend class content::WebContentsUserData<SadTabHelper>;
29 explicit SadTabHelper(content::WebContents* web_contents);
31 void InstallSadTab(base::TerminationStatus status);
33 // Overridden from content::WebContentsObserver:
34 virtual void RenderViewReady() OVERRIDE;
35 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
37 scoped_ptr<chrome::SadTab> sad_tab_;
39 DISALLOW_COPY_AND_ASSIGN(SadTabHelper);
42 #endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_