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

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: Comments addressed. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/enterprise_extension_observer.cc » ('j') | 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 extensions::ExtensionSystem::Get(profile)->extension_service()-> 402 extensions::ExtensionSystem::Get(profile)->extension_service()->
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 =
413 extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD; 413 extensions::Manifest::IsPolicyLocation(extension->location());
414 if (!force_installed) { 414 if (!force_installed) {
415 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed 415 // When an extension crashes, EXTENSION_PROCESS_TERMINATED is followed
416 // by an EXTENSION_UNLOADED notification. This UNLOADED signal causes 416 // by an EXTENSION_UNLOADED notification. This UNLOADED signal causes
417 // all the notifications for this extension to be cancelled by 417 // all the notifications for this extension to be cancelled by
418 // DesktopNotificationService. For this reason, we post the crash 418 // DesktopNotificationService. For this reason, we post the crash
419 // handling code as a task here so that it is not executed before this 419 // handling code as a task here so that it is not executed before this
420 // event. 420 // event.
421 base::MessageLoop::current()->PostTask( 421 base::MessageLoop::current()->PostTask(
422 FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); 422 FROM_HERE, base::Bind(&ShowBalloon, extension, profile));
423 } else { 423 } else {
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 bool user_gesture, 743 bool user_gesture,
744 bool* was_blocked) { 744 bool* was_blocked) {
745 Browser* browser = chrome::FindLastActiveWithProfile( 745 Browser* browser = chrome::FindLastActiveWithProfile(
746 Profile::FromBrowserContext(new_contents->GetBrowserContext()), 746 Profile::FromBrowserContext(new_contents->GetBrowserContext()),
747 chrome::GetActiveDesktop()); 747 chrome::GetActiveDesktop());
748 if (browser) { 748 if (browser) {
749 chrome::AddWebContents(browser, NULL, new_contents, disposition, 749 chrome::AddWebContents(browser, NULL, new_contents, disposition,
750 initial_pos, user_gesture, was_blocked); 750 initial_pos, user_gesture, was_blocked);
751 } 751 }
752 } 752 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/enterprise_extension_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698