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

Side by Side Diff: chrome/browser/extensions/extension_disabled_ui.cc

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/extensions/extension_disabled_ui.h" 5 #include "chrome/browser/extensions/extension_disabled_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/browser/ui/browser.h" 25 #include "chrome/browser/ui/browser.h"
26 #include "chrome/browser/ui/global_error/global_error.h" 26 #include "chrome/browser/ui/global_error/global_error.h"
27 #include "chrome/browser/ui/global_error/global_error_service.h" 27 #include "chrome/browser/ui/global_error/global_error_service.h"
28 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 28 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
29 #include "chrome/browser/ui/tabs/tab_strip_model.h" 29 #include "chrome/browser/ui/tabs/tab_strip_model.h"
30 #include "content/public/browser/notification_details.h" 30 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_observer.h" 31 #include "content/public/browser/notification_observer.h"
32 #include "content/public/browser/notification_registrar.h" 32 #include "content/public/browser/notification_registrar.h"
33 #include "content/public/browser/notification_source.h" 33 #include "content/public/browser/notification_source.h"
34 #include "extensions/browser/extension_util.h"
34 #include "extensions/common/extension.h" 35 #include "extensions/common/extension.h"
35 #include "extensions/common/extension_icon_set.h" 36 #include "extensions/common/extension_icon_set.h"
36 #include "extensions/common/manifest_handlers/icons_handler.h" 37 #include "extensions/common/manifest_handlers/icons_handler.h"
37 #include "extensions/common/permissions/permission_message_provider.h" 38 #include "extensions/common/permissions/permission_message_provider.h"
38 #include "extensions/common/permissions/permission_set.h" 39 #include "extensions/common/permissions/permission_set.h"
39 #include "grit/chromium_strings.h" 40 #include "grit/chromium_strings.h"
40 #include "grit/generated_resources.h" 41 #include "grit/generated_resources.h"
41 #include "grit/theme_resources.h" 42 #include "grit/theme_resources.h"
42 #include "ui/base/l10n/l10n_util.h" 43 #include "ui/base/l10n/l10n_util.h"
43 #include "ui/gfx/image/image.h" 44 #include "ui/gfx/image/image.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 GlobalErrorServiceFactory::GetForProfile(service->profile()) 348 GlobalErrorServiceFactory::GetForProfile(service->profile())
348 ->AddGlobalError( 349 ->AddGlobalError(
349 new ExtensionDisabledGlobalError(service.get(), extension, icon)); 350 new ExtensionDisabledGlobalError(service.get(), extension, icon));
350 } 351 }
351 } 352 }
352 353
353 void AddExtensionDisabledError(ExtensionService* service, 354 void AddExtensionDisabledError(ExtensionService* service,
354 const Extension* extension) { 355 const Extension* extension) {
355 // Do not display notifications for ephemeral apps that have been disabled. 356 // Do not display notifications for ephemeral apps that have been disabled.
356 // Instead, a prompt will be shown the next time the app is launched. 357 // Instead, a prompt will be shown the next time the app is launched.
357 if (extension->is_ephemeral()) 358 if (util::IsEphemeralApp(extension->id(), service->profile()))
358 return; 359 return;
359 360
360 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( 361 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
361 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER); 362 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER);
362 gfx::Size size(kIconSize, kIconSize); 363 gfx::Size size(kIconSize, kIconSize);
363 ImageLoader::Get(service->profile())->LoadImageAsync( 364 ImageLoader::Get(service->profile())->LoadImageAsync(
364 extension, image, size, 365 extension, image, size,
365 base::Bind(&AddExtensionDisabledErrorWithIcon, 366 base::Bind(&AddExtensionDisabledErrorWithIcon,
366 service->AsWeakPtr(), extension->id())); 367 service->AsWeakPtr(), extension->id()));
367 } 368 }
368 369
369 void ShowExtensionDisabledDialog(ExtensionService* service, 370 void ShowExtensionDisabledDialog(ExtensionService* service,
370 content::WebContents* web_contents, 371 content::WebContents* web_contents,
371 const Extension* extension) { 372 const Extension* extension) {
372 scoped_ptr<ExtensionInstallPrompt> install_ui( 373 scoped_ptr<ExtensionInstallPrompt> install_ui(
373 new ExtensionInstallPrompt(web_contents)); 374 new ExtensionInstallPrompt(web_contents));
374 // This object manages its own lifetime. 375 // This object manages its own lifetime.
375 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); 376 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension);
376 } 377 }
377 378
378 } // namespace extensions 379 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698