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

Side by Side Diff: chrome/browser/background/background_contents_service.cc

Issue 160923002: Fixes a typo: use the default image if the extension doesn't have icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-upload Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/background/background_contents_service.h" 5 #include "chrome/browser/background/background_contents_service.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 }; 159 };
160 160
161 #if defined(ENABLE_NOTIFICATIONS) 161 #if defined(ENABLE_NOTIFICATIONS)
162 void NotificationImageReady( 162 void NotificationImageReady(
163 const std::string extension_name, 163 const std::string extension_name,
164 const base::string16 message, 164 const base::string16 message,
165 scoped_refptr<CrashNotificationDelegate> delegate, 165 scoped_refptr<CrashNotificationDelegate> delegate,
166 Profile* profile, 166 Profile* profile,
167 const gfx::Image& icon) { 167 const gfx::Image& icon) {
168 gfx::Image notification_icon(icon); 168 gfx::Image notification_icon(icon);
169 if (icon.IsEmpty()) { 169 if (icon.IsEmpty()) {
dewittj 2014/02/12 21:29:55 nit: change this to notification_icon.IsEmpty
Jun Mukai 2014/02/12 21:42:23 Done.
170 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 170 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
171 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON); 171 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON);
172 } 172 }
173 173
174 // Origin URL must be different from the crashed extension to avoid the 174 // Origin URL must be different from the crashed extension to avoid the
175 // conflict. NotificationSystemObserver will cancel all notifications from 175 // conflict. NotificationSystemObserver will cancel all notifications from
176 // the same origin when NOTIFICATION_EXTENSION_UNLOADED. 176 // the same origin when NOTIFICATION_EXTENSION_UNLOADED.
177 // TODO(mukai, dewittj): remove this and switch to message center 177 // TODO(mukai, dewittj): remove this and switch to message center
178 // notifications. 178 // notifications.
179 DesktopNotificationService::AddIconNotification( 179 DesktopNotificationService::AddIconNotification(
180 GURL() /* empty origin */, 180 GURL() /* empty origin */,
181 base::string16(), 181 base::string16(),
182 message, 182 message,
183 icon, 183 notification_icon,
184 base::string16(), 184 base::string16(),
185 delegate.get(), 185 delegate.get(),
186 profile); 186 profile);
187 } 187 }
188 #endif 188 #endif
189 189
190 // Show a popup notification balloon with a crash message for a given app/ 190 // Show a popup notification balloon with a crash message for a given app/
191 // extension. 191 // extension.
192 void ShowBalloon(const Extension* extension, Profile* profile) { 192 void ShowBalloon(const Extension* extension, Profile* profile) {
193 #if defined(ENABLE_NOTIFICATIONS) 193 #if defined(ENABLE_NOTIFICATIONS)
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 bool user_gesture, 766 bool user_gesture,
767 bool* was_blocked) { 767 bool* was_blocked) {
768 Browser* browser = chrome::FindLastActiveWithProfile( 768 Browser* browser = chrome::FindLastActiveWithProfile(
769 Profile::FromBrowserContext(new_contents->GetBrowserContext()), 769 Profile::FromBrowserContext(new_contents->GetBrowserContext()),
770 chrome::GetActiveDesktop()); 770 chrome::GetActiveDesktop());
771 if (browser) { 771 if (browser) {
772 chrome::AddWebContents(browser, NULL, new_contents, disposition, 772 chrome::AddWebContents(browser, NULL, new_contents, disposition,
773 initial_pos, user_gesture, was_blocked); 773 initial_pos, user_gesture, was_blocked);
774 } 774 }
775 } 775 }
OLDNEW
« 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