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

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

Issue 24365004: Add EXTERNAL_POLICY to list of possible extension locations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 GetExtensionById(extension_id, false); 403 GetExtensionById(extension_id, false);
404 } else { 404 } else {
405 extensions::ExtensionHost* extension_host = 405 extensions::ExtensionHost* extension_host =
406 content::Details<extensions::ExtensionHost>(details).ptr(); 406 content::Details<extensions::ExtensionHost>(details).ptr();
407 extension = extension_host->extension(); 407 extension = extension_host->extension();
408 } 408 }
409 if (!extension) 409 if (!extension)
410 break; 410 break;
411 411
412 const bool force_installed = extension->location() == 412 const bool force_installed = extension->location() ==
413 extensions::Manifest::EXTERNAL_POLICY ||
413 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD; 414 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD;
414 if (!force_installed) { 415 if (!force_installed) {
415 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed 416 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed
416 // by an EXTENSION_UNLOADED notification. This UNLOADED signal causes 417 // by an EXTENSION_UNLOADED notification. This UNLOADED signal causes
417 // all the notifications for this extension to be cancelled by 418 // all the notifications for this extension to be cancelled by
418 // DesktopNotificationService. For this reason, we post the crash 419 // DesktopNotificationService. For this reason, we post the crash
419 // handling code as a task here so that it is not executed before this 420 // handling code as a task here so that it is not executed before this
420 // event. 421 // event.
421 base::MessageLoop::current()->PostTask( 422 base::MessageLoop::current()->PostTask(
422 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); 423 FROM_HERE, base::Bind(&ShowBalloon, extension, profile));
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 bool user_gesture, 744 bool user_gesture,
744 bool* was_blocked) { 745 bool* was_blocked) {
745 Browser* browser = chrome::FindLastActiveWithProfile( 746 Browser* browser = chrome::FindLastActiveWithProfile(
746 Profile::FromBrowserContext(new_contents->GetBrowserContext()), 747 Profile::FromBrowserContext(new_contents->GetBrowserContext()),
747 chrome::GetActiveDesktop()); 748 chrome::GetActiveDesktop());
748 if (browser) { 749 if (browser) {
749 chrome::AddWebContents(browser, NULL, new_contents, disposition, 750 chrome::AddWebContents(browser, NULL, new_contents, disposition,
750 initial_pos, user_gesture, was_blocked); 751 initial_pos, user_gesture, was_blocked);
751 } 752 }
752 } 753 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698