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

Side by Side Diff: chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc

Issue 8865004: Create CoreTabHelper, move remaining core TCW functionality into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lots of helpers now Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_dialogs.h" 5 #include "chrome/browser/ui/browser_dialogs.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "chrome/browser/favicon/favicon_tab_helper.h" 11 #include "chrome/browser/favicon/favicon_tab_helper.h"
12 #include "chrome/browser/ui/browser_list.h" 12 #include "chrome/browser/ui/browser_list.h"
13 #include "chrome/browser/ui/gtk/gtk_util.h" 13 #include "chrome/browser/ui/gtk/gtk_util.h"
14 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "chrome/common/logging_chrome.h" 16 #include "chrome/common/logging_chrome.h"
16 #include "content/browser/renderer_host/render_view_host.h" 17 #include "content/browser/renderer_host/render_view_host.h"
17 #include "content/browser/tab_contents/tab_contents.h" 18 #include "content/browser/tab_contents/tab_contents.h"
18 #include "content/public/browser/render_process_host.h" 19 #include "content/public/browser/render_process_host.h"
19 #include "content/public/common/result_codes.h" 20 #include "content/public/common/result_codes.h"
20 #include "grit/chromium_strings.h" 21 #include "grit/chromium_strings.h"
21 #include "grit/generated_resources.h" 22 #include "grit/generated_resources.h"
22 #include "grit/theme_resources.h" 23 #include "grit/theme_resources.h"
23 #include "ui/base/gtk/gtk_hig_constants.h" 24 #include "ui/base/gtk/gtk_hig_constants.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 contents_observer_.reset(new TabContentsObserverImpl(this, contents_)); 179 contents_observer_.reset(new TabContentsObserverImpl(this, contents_));
179 gtk_list_store_clear(model_); 180 gtk_list_store_clear(model_);
180 181
181 GtkTreeIter tree_iter; 182 GtkTreeIter tree_iter;
182 for (TabContentsIterator it; !it.done(); ++it) { 183 for (TabContentsIterator it; !it.done(); ++it) {
183 if (it->tab_contents()->GetRenderProcessHost() == 184 if (it->tab_contents()->GetRenderProcessHost() ==
184 hung_contents->GetRenderProcessHost()) { 185 hung_contents->GetRenderProcessHost()) {
185 gtk_list_store_append(model_, &tree_iter); 186 gtk_list_store_append(model_, &tree_iter);
186 std::string title = UTF16ToUTF8(it->tab_contents()->GetTitle()); 187 std::string title = UTF16ToUTF8(it->tab_contents()->GetTitle());
187 if (title.empty()) 188 if (title.empty())
188 title = UTF16ToUTF8(TabContentsWrapper::GetDefaultTitle()); 189 title = UTF16ToUTF8(CoreTabHelper::GetDefaultTitle());
189 SkBitmap favicon = it->favicon_tab_helper()->GetFavicon(); 190 SkBitmap favicon = it->favicon_tab_helper()->GetFavicon();
190 191
191 GdkPixbuf* pixbuf = NULL; 192 GdkPixbuf* pixbuf = NULL;
192 if (favicon.width() > 0) 193 if (favicon.width() > 0)
193 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon); 194 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon);
194 gtk_list_store_set(model_, &tree_iter, 195 gtk_list_store_set(model_, &tree_iter,
195 COL_FAVICON, pixbuf, 196 COL_FAVICON, pixbuf,
196 COL_TITLE, title.c_str(), 197 COL_TITLE, title.c_str(),
197 -1); 198 -1);
198 if (pixbuf) 199 if (pixbuf)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 g_instance->ShowForTabContents(contents); 257 g_instance->ShowForTabContents(contents);
257 } 258 }
258 } 259 }
259 260
260 void HideNativeHungRendererDialog(TabContents* contents) { 261 void HideNativeHungRendererDialog(TabContents* contents) {
261 if (!logging::DialogsAreSuppressed() && g_instance) 262 if (!logging::DialogsAreSuppressed() && g_instance)
262 g_instance->EndForTabContents(contents); 263 g_instance->EndForTabContents(contents);
263 } 264 }
264 265
265 } // namespace browser 266 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698