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

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

Issue 6814029: Revert 80519 - Move favicon from TabContents to TabContentsWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
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_tab_helper.h"
12 #include "chrome/browser/ui/browser_list.h" 11 #include "chrome/browser/ui/browser_list.h"
13 #include "chrome/browser/ui/gtk/gtk_util.h" 12 #include "chrome/browser/ui/gtk/gtk_util.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
15 #include "chrome/common/logging_chrome.h" 14 #include "chrome/common/logging_chrome.h"
16 #include "content/browser/renderer_host/render_process_host.h" 15 #include "content/browser/renderer_host/render_process_host.h"
17 #include "content/browser/renderer_host/render_view_host.h" 16 #include "content/browser/renderer_host/render_view_host.h"
18 #include "content/browser/tab_contents/tab_contents.h" 17 #include "content/browser/tab_contents/tab_contents.h"
19 #include "content/common/result_codes.h" 18 #include "content/common/result_codes.h"
20 #include "grit/chromium_strings.h" 19 #include "grit/chromium_strings.h"
21 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 gtk_list_store_clear(model_); 147 gtk_list_store_clear(model_);
149 148
150 GtkTreeIter tree_iter; 149 GtkTreeIter tree_iter;
151 for (TabContentsIterator it; !it.done(); ++it) { 150 for (TabContentsIterator it; !it.done(); ++it) {
152 if (it->tab_contents()->GetRenderProcessHost() == 151 if (it->tab_contents()->GetRenderProcessHost() ==
153 hung_contents->GetRenderProcessHost()) { 152 hung_contents->GetRenderProcessHost()) {
154 gtk_list_store_append(model_, &tree_iter); 153 gtk_list_store_append(model_, &tree_iter);
155 std::string title = UTF16ToUTF8(it->tab_contents()->GetTitle()); 154 std::string title = UTF16ToUTF8(it->tab_contents()->GetTitle());
156 if (title.empty()) 155 if (title.empty())
157 title = UTF16ToUTF8(TabContentsWrapper::GetDefaultTitle()); 156 title = UTF16ToUTF8(TabContentsWrapper::GetDefaultTitle());
158 SkBitmap favicon = it->favicon_tab_helper()->GetFavicon(); 157 SkBitmap favicon = it->tab_contents()->GetFavicon();
159 158
160 GdkPixbuf* pixbuf = NULL; 159 GdkPixbuf* pixbuf = NULL;
161 if (favicon.width() > 0) 160 if (favicon.width() > 0)
162 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon); 161 pixbuf = gfx::GdkPixbufFromSkBitmap(&favicon);
163 gtk_list_store_set(model_, &tree_iter, 162 gtk_list_store_set(model_, &tree_iter,
164 COL_FAVICON, pixbuf, 163 COL_FAVICON, pixbuf,
165 COL_TITLE, title.c_str(), 164 COL_TITLE, title.c_str(),
166 -1); 165 -1);
167 if (pixbuf) 166 if (pixbuf)
168 g_object_unref(pixbuf); 167 g_object_unref(pixbuf);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 g_instance->ShowForTabContents(contents); 219 g_instance->ShowForTabContents(contents);
221 } 220 }
222 } 221 }
223 222
224 void HideHungRendererDialog(TabContents* contents) { 223 void HideHungRendererDialog(TabContents* contents) {
225 if (!logging::DialogsAreSuppressed() && g_instance) 224 if (!logging::DialogsAreSuppressed() && g_instance)
226 g_instance->EndForTabContents(contents); 225 g_instance->EndForTabContents(contents);
227 } 226 }
228 227
229 } // namespace browser 228 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698