OLD | NEW |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 const GURL extension_url, | 132 const GURL extension_url, |
133 scoped_refptr<CrashNotificationDelegate> delegate, | 133 scoped_refptr<CrashNotificationDelegate> delegate, |
134 Profile* profile, | 134 Profile* profile, |
135 const gfx::Image& icon) { | 135 const gfx::Image& icon) { |
136 gfx::Image notification_icon(icon); | 136 gfx::Image notification_icon(icon); |
137 if (icon.IsEmpty()) { | 137 if (icon.IsEmpty()) { |
138 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 138 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
139 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON); | 139 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON); |
140 } | 140 } |
141 string16 title; // no notification title | 141 string16 title; // no notification title |
142 DesktopNotificationService::AddIconNotification( | 142 DesktopNotificationService::AddIconNotification(extension_url, |
143 extension_url, | 143 title, |
144 title, | 144 message, |
145 message, | 145 notification_icon, |
146 notification_icon, | 146 string16(), |
147 string16(), | 147 delegate.get(), |
148 delegate, | 148 profile); |
149 profile); | |
150 } | 149 } |
151 #endif | 150 #endif |
152 | 151 |
153 void ShowBalloon(const Extension* extension, Profile* profile) { | 152 void ShowBalloon(const Extension* extension, Profile* profile) { |
154 #if defined(ENABLE_NOTIFICATIONS) | 153 #if defined(ENABLE_NOTIFICATIONS) |
155 string16 message = l10n_util::GetStringFUTF16( | 154 string16 message = l10n_util::GetStringFUTF16( |
156 extension->is_app() ? IDS_BACKGROUND_CRASHED_APP_BALLOON_MESSAGE : | 155 extension->is_app() ? IDS_BACKGROUND_CRASHED_APP_BALLOON_MESSAGE : |
157 IDS_BACKGROUND_CRASHED_EXTENSION_BALLOON_MESSAGE, | 156 IDS_BACKGROUND_CRASHED_EXTENSION_BALLOON_MESSAGE, |
158 UTF8ToUTF16(extension->name())); | 157 UTF8ToUTF16(extension->name())); |
159 | 158 |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 bool user_gesture, | 681 bool user_gesture, |
683 bool* was_blocked) { | 682 bool* was_blocked) { |
684 Browser* browser = chrome::FindLastActiveWithProfile( | 683 Browser* browser = chrome::FindLastActiveWithProfile( |
685 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 684 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
686 chrome::GetActiveDesktop()); | 685 chrome::GetActiveDesktop()); |
687 if (browser) { | 686 if (browser) { |
688 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 687 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
689 initial_pos, user_gesture, was_blocked); | 688 initial_pos, user_gesture, was_blocked); |
690 } | 689 } |
691 } | 690 } |
OLD | NEW |