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

Side by Side Diff: chrome/browser/ui/views/hung_renderer_view.cc

Issue 10837215: exhibit 1: explicit null checks Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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) 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/views/hung_renderer_view.h" 5 #include "chrome/browser/ui/views/hung_renderer_view.h"
6 6
7 #if defined(OS_WIN) && !defined(USE_AURA) 7 #if defined(OS_WIN) && !defined(USE_AURA)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 title = CoreTabHelper::GetDefaultTitle(); 113 title = CoreTabHelper::GetDefaultTitle();
114 // TODO(xji): Consider adding a special case if the title text is a URL, 114 // TODO(xji): Consider adding a special case if the title text is a URL,
115 // since those should always have LTR directionality. Please refer to 115 // since those should always have LTR directionality. Please refer to
116 // http://crbug.com/6726 for more information. 116 // http://crbug.com/6726 for more information.
117 base::i18n::AdjustStringForLocaleDirection(&title); 117 base::i18n::AdjustStringForLocaleDirection(&title);
118 return title; 118 return title;
119 } 119 }
120 120
121 gfx::ImageSkia HungPagesTableModel::GetIcon(int row) { 121 gfx::ImageSkia HungPagesTableModel::GetIcon(int row) {
122 DCHECK(row >= 0 && row < RowCount()); 122 DCHECK(row >= 0 && row < RowCount());
123 return tab_observers_[row]->favicon_tab_helper()->GetFavicon().AsImageSkia(); 123 const gfx::Image& icon =
124 tab_observers_[row]->favicon_tab_helper()->GetFavicon();
125 return icon.IsEmpty() ? gfx::ImageSkia() : *icon.ToImageSkia();
124 } 126 }
125 127
126 void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) { 128 void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) {
127 observer_ = observer; 129 observer_ = observer;
128 } 130 }
129 131
130 void HungPagesTableModel::GetGroupRangeForItem(int item, 132 void HungPagesTableModel::GetGroupRangeForItem(int item,
131 views::GroupRange* range) { 133 views::GroupRange* range) {
132 DCHECK(range); 134 DCHECK(range);
133 range->start = 0; 135 range->start = 0;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 471 }
470 472
471 void HideHungRendererDialog(WebContents* contents) { 473 void HideHungRendererDialog(WebContents* contents) {
472 if (!logging::DialogsAreSuppressed() && 474 if (!logging::DialogsAreSuppressed() &&
473 !PlatformHideCustomHungRendererDialog(contents) && 475 !PlatformHideCustomHungRendererDialog(contents) &&
474 HungRendererDialogView::GetInstance()) 476 HungRendererDialogView::GetInstance())
475 HungRendererDialogView::GetInstance()->EndForWebContents(contents); 477 HungRendererDialogView::GetInstance()->EndForWebContents(contents);
476 } 478 }
477 479
478 } // namespace chrome 480 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698