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

Unified Diff: ui/aura_shell/launcher/launcher_view.cc

Issue 8914012: Fixes crash in launcher. Some tests don't end up creating a delegate, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/launcher/launcher_view.cc
diff --git a/ui/aura_shell/launcher/launcher_view.cc b/ui/aura_shell/launcher/launcher_view.cc
index 7847f7712ccf0dfdf661f56875139db9d4d929f3..0f78a9b7c9efed68166d212b648b82e86855ca24 100644
--- a/ui/aura_shell/launcher/launcher_view.cc
+++ b/ui/aura_shell/launcher/launcher_view.cc
@@ -205,8 +205,10 @@ void LauncherView::Init() {
model_->AddObserver(this);
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
new_browser_button_ = new views::ImageButton(this);
- int new_browser_button_image_id =
- Shell::GetInstance()->delegate()->GetResourceIDForNewBrowserWindow();
+ ShellDelegate* delegate = Shell::GetInstance()->delegate();
+ int new_browser_button_image_id = delegate ?
+ delegate->GetResourceIDForNewBrowserWindow() :
+ IDR_AURA_LAUNCHER_ICON_CHROME;
new_browser_button_->SetImage(
views::CustomButton::BS_NORMAL,
rb.GetImageNamed(new_browser_button_image_id).ToSkBitmap());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698