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

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

Issue 10824030: Move ExtensionHost into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq 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
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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 const Extension* extension = NULL; 292 const Extension* extension = NULL;
293 if (type == chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED) { 293 if (type == chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED) {
294 BackgroundContents* bg = 294 BackgroundContents* bg =
295 content::Details<BackgroundContents>(details).ptr(); 295 content::Details<BackgroundContents>(details).ptr();
296 std::string extension_id = UTF16ToASCII( 296 std::string extension_id = UTF16ToASCII(
297 BackgroundContentsServiceFactory::GetForProfile(profile)-> 297 BackgroundContentsServiceFactory::GetForProfile(profile)->
298 GetParentApplicationId(bg)); 298 GetParentApplicationId(bg));
299 extension = 299 extension =
300 profile->GetExtensionService()->GetExtensionById(extension_id, false); 300 profile->GetExtensionService()->GetExtensionById(extension_id, false);
301 } else { 301 } else {
302 ExtensionHost* extension_host = 302 extensions::ExtensionHost* extension_host =
303 content::Details<ExtensionHost>(details).ptr(); 303 content::Details<extensions::ExtensionHost>(details).ptr();
304 extension = extension_host->extension(); 304 extension = extension_host->extension();
305 } 305 }
306 if (!extension) 306 if (!extension)
307 break; 307 break;
308 308
309 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed by 309 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed by
310 // an EXTENSION_UNLOADED notification. This UNLOADED signal causes all the 310 // an EXTENSION_UNLOADED notification. This UNLOADED signal causes all the
311 // notifications for this extension to be cancelled by 311 // notifications for this extension to be cancelled by
312 // DesktopNotificationService. For this reason, instead of showing the 312 // DesktopNotificationService. For this reason, instead of showing the
313 // balloon right now, we schedule it to show a little later. 313 // balloon right now, we schedule it to show a little later.
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 WindowOpenDisposition disposition, 613 WindowOpenDisposition disposition,
614 const gfx::Rect& initial_pos, 614 const gfx::Rect& initial_pos,
615 bool user_gesture) { 615 bool user_gesture) {
616 Browser* browser = browser::FindLastActiveWithProfile( 616 Browser* browser = browser::FindLastActiveWithProfile(
617 Profile::FromBrowserContext(new_contents->GetBrowserContext())); 617 Profile::FromBrowserContext(new_contents->GetBrowserContext()));
618 if (browser) { 618 if (browser) {
619 chrome::AddWebContents(browser, NULL, new_contents, disposition, 619 chrome::AddWebContents(browser, NULL, new_contents, disposition,
620 initial_pos, user_gesture); 620 initial_pos, user_gesture);
621 } 621 }
622 } 622 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.cc ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698