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

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: Fix up file header 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 ->AddGlobalError(new ExtensionDisabledGlobalError( 388 ->AddGlobalError(new ExtensionDisabledGlobalError(
388 service.get(), extension, is_remote_install, icon)); 389 service.get(), extension, is_remote_install, icon));
389 } 390 }
390 } 391 }
391 392
392 void AddExtensionDisabledError(ExtensionService* service, 393 void AddExtensionDisabledError(ExtensionService* service,
393 const Extension* extension, 394 const Extension* extension,
394 bool is_remote_install) { 395 bool is_remote_install) {
395 // Do not display notifications for ephemeral apps that have been disabled. 396 // Do not display notifications for ephemeral apps that have been disabled.
396 // Instead, a prompt will be shown the next time the app is launched. 397 // Instead, a prompt will be shown the next time the app is launched.
397 if (extension->is_ephemeral()) 398 if (util::IsEphemeralApp(extension->id(), service->profile()))
398 return; 399 return;
399 400
400 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( 401 extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
401 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER); 402 extension, kIconSize, ExtensionIconSet::MATCH_BIGGER);
402 gfx::Size size(kIconSize, kIconSize); 403 gfx::Size size(kIconSize, kIconSize);
403 ImageLoader::Get(service->profile()) 404 ImageLoader::Get(service->profile())
404 ->LoadImageAsync(extension, 405 ->LoadImageAsync(extension,
405 image, 406 image,
406 size, 407 size,
407 base::Bind(&AddExtensionDisabledErrorWithIcon, 408 base::Bind(&AddExtensionDisabledErrorWithIcon,
408 service->AsWeakPtr(), 409 service->AsWeakPtr(),
409 extension->id(), 410 extension->id(),
410 is_remote_install)); 411 is_remote_install));
411 } 412 }
412 413
413 void ShowExtensionDisabledDialog(ExtensionService* service, 414 void ShowExtensionDisabledDialog(ExtensionService* service,
414 content::WebContents* web_contents, 415 content::WebContents* web_contents,
415 const Extension* extension) { 416 const Extension* extension) {
416 scoped_ptr<ExtensionInstallPrompt> install_ui( 417 scoped_ptr<ExtensionInstallPrompt> install_ui(
417 new ExtensionInstallPrompt(web_contents)); 418 new ExtensionInstallPrompt(web_contents));
418 // This object manages its own lifetime. 419 // This object manages its own lifetime.
419 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension); 420 new ExtensionDisabledDialogDelegate(service, install_ui.Pass(), extension);
420 } 421 }
421 422
422 } // namespace extensions 423 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.cc ('k') | chrome/browser/extensions/extension_install_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698