Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(805)

Unified Diff: components/sad_tab/sad_tab_helper.h

Issue 543663002: Componentize sad_tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix url_constants.cc Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/sad_tab/sad_tab_client.h ('k') | components/sad_tab/sad_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sad_tab/sad_tab_helper.h
diff --git a/chrome/browser/ui/sad_tab_helper.h b/components/sad_tab/sad_tab_helper.h
similarity index 63%
rename from chrome/browser/ui/sad_tab_helper.h
rename to components/sad_tab/sad_tab_helper.h
index f61da72e28b0b660c4758e0f8708596591534d0c..5926de4e506e24b1ef7be2e6cab3222140343d7e 100644
--- a/chrome/browser/ui/sad_tab_helper.h
+++ b/components/sad_tab/sad_tab_helper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
-#define CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
+#ifndef COMPONENTS_SAD_TAB_SAD_TAB_HELPER_H_
+#define COMPONENTS_SAD_TAB_SAD_TAB_HELPER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -11,22 +11,28 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
-namespace chrome {
+namespace sad_tab {
+
class SadTab;
-}
+class SadTabClient;
// Per-tab class to manage sad tab views.
class SadTabHelper : public content::WebContentsObserver,
public content::WebContentsUserData<SadTabHelper> {
public:
+ static void CreateForWebContentsWithClient(
+ content::WebContents* contents,
+ scoped_ptr<SadTabClient> client);
+
virtual ~SadTabHelper();
- chrome::SadTab* sad_tab() { return sad_tab_.get(); }
+ SadTab* sad_tab() { return sad_tab_.get(); }
private:
friend class content::WebContentsUserData<SadTabHelper>;
- explicit SadTabHelper(content::WebContents* web_contents);
+ SadTabHelper(content::WebContents* web_contents,
+ scoped_ptr<SadTabClient> client);
void InstallSadTab(base::TerminationStatus status);
@@ -34,9 +40,12 @@ class SadTabHelper : public content::WebContentsObserver,
virtual void RenderViewReady() OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
- scoped_ptr<chrome::SadTab> sad_tab_;
+ scoped_ptr<SadTabClient> client_;
+ scoped_ptr<SadTab> sad_tab_;
DISALLOW_COPY_AND_ASSIGN(SadTabHelper);
};
-#endif // CHROME_BROWSER_UI_SAD_TAB_HELPER_H_
+} // namespace sad_tab
+
+#endif // COMPONENTS_SAD_TAB_SAD_TAB_HELPER_H_
« no previous file with comments | « components/sad_tab/sad_tab_client.h ('k') | components/sad_tab/sad_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698