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

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

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