OLD | NEW |
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/external_install_ui.h" | 5 #include "chrome/browser/extensions/external_install_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 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/browser/ui/browser_finder.h" | 23 #include "chrome/browser/ui/browser_finder.h" |
24 #include "chrome/browser/ui/global_error/global_error.h" | 24 #include "chrome/browser/ui/global_error/global_error.h" |
25 #include "chrome/browser/ui/global_error/global_error_service.h" | 25 #include "chrome/browser/ui/global_error/global_error_service.h" |
26 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 26 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
27 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
29 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
| 31 #include "chrome/common/extensions/manifest_url_handler.h" |
31 #include "content/public/browser/notification_details.h" | 32 #include "content/public/browser/notification_details.h" |
32 #include "content/public/browser/notification_observer.h" | 33 #include "content/public/browser/notification_observer.h" |
33 #include "content/public/browser/notification_registrar.h" | 34 #include "content/public/browser/notification_registrar.h" |
34 #include "content/public/browser/notification_source.h" | 35 #include "content/public/browser/notification_source.h" |
35 #include "grit/chromium_strings.h" | 36 #include "grit/chromium_strings.h" |
36 #include "grit/generated_resources.h" | 37 #include "grit/generated_resources.h" |
37 #include "grit/theme_resources.h" | 38 #include "grit/theme_resources.h" |
38 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
39 #include "ui/gfx/image/image.h" | 40 #include "ui/gfx/image/image.h" |
40 #include "ui/gfx/image/image_skia_operations.h" | 41 #include "ui/gfx/image/image_skia_operations.h" |
41 #include "ui/gfx/size.h" | 42 #include "ui/gfx/size.h" |
42 | 43 |
43 namespace extensions { | 44 namespace extensions { |
44 | 45 |
45 namespace { | 46 namespace { |
46 | 47 |
47 // Whether the external extension can use the streamlined bubble install flow. | 48 // Whether the external extension can use the streamlined bubble install flow. |
48 bool UseBubbleInstall(const Extension* extension, bool is_new_profile) { | 49 bool UseBubbleInstall(const Extension* extension, bool is_new_profile) { |
49 return extension->UpdatesFromGallery() && !is_new_profile; | 50 return ManifestURL::UpdatesFromGallery(extension) && !is_new_profile; |
50 } | 51 } |
51 | 52 |
52 } // namespace | 53 } // namespace |
53 | 54 |
54 static const int kMenuCommandId = IDC_EXTERNAL_EXTENSION_ALERT; | 55 static const int kMenuCommandId = IDC_EXTERNAL_EXTENSION_ALERT; |
55 | 56 |
56 class ExternalInstallGlobalError; | 57 class ExternalInstallGlobalError; |
57 | 58 |
58 // TODO(mpcomplete): Get rid of the refcounting on this class, or document | 59 // TODO(mpcomplete): Get rid of the refcounting on this class, or document |
59 // why it's necessary. Will do after refactoring to merge back with | 60 // why it's necessary. Will do after refactoring to merge back with |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 | 445 |
445 bool HasExternalInstallBubble(ExtensionService* service) { | 446 bool HasExternalInstallBubble(ExtensionService* service) { |
446 GlobalErrorService* error_service = | 447 GlobalErrorService* error_service = |
447 GlobalErrorServiceFactory::GetForProfile(service->profile()); | 448 GlobalErrorServiceFactory::GetForProfile(service->profile()); |
448 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( | 449 GlobalError* error = error_service->GetGlobalErrorByMenuItemCommandID( |
449 kMenuCommandId); | 450 kMenuCommandId); |
450 return error && error->HasBubbleView(); | 451 return error && error->HasBubbleView(); |
451 } | 452 } |
452 | 453 |
453 } // namespace extensions | 454 } // namespace extensions |
OLD | NEW |