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

Side by Side Diff: chrome/browser/ui/sad_tab_helper.cc

Issue 10949011: Switch SadTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, win fix Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/sad_tab_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/ui/sad_tab_helper.h" 5 #include "chrome/browser/ui/sad_tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/browser_shutdown.h" 8 #include "chrome/browser/browser_shutdown.h"
9 #include "chrome/browser/ui/sad_tab_types.h" 9 #include "chrome/browser/ui/sad_tab_types.h"
10 #include "content/public/browser/notification_source.h" 10 #include "content/public/browser/notification_source.h"
11 #include "content/public/browser/notification_types.h" 11 #include "content/public/browser/notification_types.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/browser/web_contents_view.h" 13 #include "content/public/browser/web_contents_view.h"
14 14
15 #if defined(OS_MACOSX) 15 #if defined(OS_MACOSX)
16 #include "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h" 16 #include "chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h"
17 #elif defined(TOOLKIT_VIEWS) 17 #elif defined(TOOLKIT_VIEWS)
18 #include "chrome/browser/ui/views/sad_tab_view.h" 18 #include "chrome/browser/ui/views/sad_tab_view.h"
19 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
20 #elif defined(TOOLKIT_GTK) 20 #elif defined(TOOLKIT_GTK)
21 #include <gtk/gtk.h> 21 #include <gtk/gtk.h>
22 22
23 #include "chrome/browser/ui/gtk/sad_tab_gtk.h" 23 #include "chrome/browser/ui/gtk/sad_tab_gtk.h"
24 #include "chrome/browser/ui/gtk/tab_contents/chrome_web_contents_view_delegate_g tk.h" 24 #include "chrome/browser/ui/gtk/tab_contents/chrome_web_contents_view_delegate_g tk.h"
25 #endif 25 #endif
26 26
27 int SadTabHelper::kUserDataKey;
28
27 SadTabHelper::SadTabHelper(content::WebContents* web_contents) 29 SadTabHelper::SadTabHelper(content::WebContents* web_contents)
28 : content::WebContentsObserver(web_contents) { 30 : content::WebContentsObserver(web_contents) {
29 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, 31 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
30 content::Source<content::WebContents>(web_contents)); 32 content::Source<content::WebContents>(web_contents));
31 } 33 }
32 34
33 SadTabHelper::~SadTabHelper() { 35 SadTabHelper::~SadTabHelper() {
34 } 36 }
35 37
36 bool SadTabHelper::HasSadTab() const { 38 bool SadTabHelper::HasSadTab() const {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 sad_tab_.reset(new SadTabGtk(web_contents(), kind)); 127 sad_tab_.reset(new SadTabGtk(web_contents(), kind));
126 GtkWidget* expanded_container = 128 GtkWidget* expanded_container =
127 ChromeWebContentsViewDelegateGtk::GetFor(web_contents())-> 129 ChromeWebContentsViewDelegateGtk::GetFor(web_contents())->
128 expanded_container(); 130 expanded_container();
129 gtk_container_add(GTK_CONTAINER(expanded_container), sad_tab_->widget()); 131 gtk_container_add(GTK_CONTAINER(expanded_container), sad_tab_->widget());
130 gtk_widget_show(sad_tab_->widget()); 132 gtk_widget_show(sad_tab_->widget());
131 #else 133 #else
132 #error Unknown platform 134 #error Unknown platform
133 #endif 135 #endif
134 } 136 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sad_tab_helper.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698