Chromium Code Reviews| 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/ui/app_list/app_list_controller_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 10 #include "chrome/browser/extensions/install_tracker_factory.h" | 10 #include "chrome/browser/extensions/install_tracker_factory.h" |
| 11 #include "chrome/browser/extensions/launch_util.h" | 11 #include "chrome/browser/extensions/launch_util.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/app_list/extension_uninstaller.h" | 13 #include "chrome/browser/ui/app_list/extension_uninstaller.h" |
| 14 #include "chrome/browser/ui/apps/app_info_dialog.h" | 14 #include "chrome/browser/ui/apps/app_info_dialog.h" |
| 15 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
| 16 #include "extensions/browser/extension_prefs.h" | 16 #include "extensions/browser/extension_prefs.h" |
| 17 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
| 19 #include "extensions/browser/management_policy.h" | 19 #include "extensions/browser/management_policy.h" |
| 20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
| 21 #include "extensions/common/extension_set.h" | 21 #include "extensions/common/extension_set.h" |
| 22 #include "extensions/common/manifest_handlers/options_page_info.h" | 22 #include "extensions/common/manifest_handlers/options_page_info.h" |
| 23 #include "extensions/common/manifest_url_handlers.h" | 23 #include "extensions/common/manifest_url_handlers.h" |
| 24 #include "net/base/url_util.h" | 24 #include "net/base/url_util.h" |
| 25 #include "ui/app_list/app_list_folder_item.h" | 25 #include "ui/app_list/app_list_folder_item.h" |
| 26 #include "ui/app_list/app_list_item.h" | 26 #include "ui/app_list/app_list_item.h" |
| 27 #include "ui/app_list/app_list_model.h" | 27 #include "ui/app_list/app_list_model.h" |
| 28 #include "ui/app_list/app_list_switches.h" | 28 #include "ui/app_list/app_list_switches.h" |
|
tapted
2015/02/12 22:45:39
can this be removed now?
| |
| 29 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
| 30 | 30 |
| 31 #if defined(ENABLE_RLZ) | 31 #if defined(ENABLE_RLZ) |
| 32 #include "chrome/browser/rlz/rlz.h" | 32 #include "chrome/browser/rlz/rlz.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 using extensions::ExtensionRegistry; | 35 using extensions::ExtensionRegistry; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 Profile* profile, | 80 Profile* profile, |
| 81 const std::string& app_id) { | 81 const std::string& app_id) { |
| 82 const extensions::Extension* extension = GetExtension(profile, app_id); | 82 const extensions::Extension* extension = GetExtension(profile, app_id); |
| 83 const extensions::ManagementPolicy* policy = | 83 const extensions::ManagementPolicy* policy = |
| 84 extensions::ExtensionSystem::Get(profile)->management_policy(); | 84 extensions::ExtensionSystem::Get(profile)->management_policy(); |
| 85 return extension && | 85 return extension && |
| 86 policy->UserMayModifySettings(extension, NULL); | 86 policy->UserMayModifySettings(extension, NULL); |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool AppListControllerDelegate::CanDoShowAppInfoFlow() { | 89 bool AppListControllerDelegate::CanDoShowAppInfoFlow() { |
| 90 return app_list::switches::IsAppInfoEnabled(); | 90 return CanShowAppInfoDialog(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void AppListControllerDelegate::DoShowAppInfoFlow( | 93 void AppListControllerDelegate::DoShowAppInfoFlow( |
| 94 Profile* profile, | 94 Profile* profile, |
| 95 const std::string& extension_id) { | 95 const std::string& extension_id) { |
| 96 DCHECK(CanDoShowAppInfoFlow()); | 96 DCHECK(CanDoShowAppInfoFlow()); |
| 97 ExtensionService* service = | 97 ExtensionService* service = |
| 98 extensions::ExtensionSystem::Get(profile)->extension_service(); | 98 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 99 DCHECK(service); | 99 DCHECK(service); |
| 100 const extensions::Extension* extension = service->GetInstalledExtension( | 100 const extensions::Extension* extension = service->GetInstalledExtension( |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 out_apps->InsertAll(registry->enabled_extensions()); | 210 out_apps->InsertAll(registry->enabled_extensions()); |
| 211 out_apps->InsertAll(registry->disabled_extensions()); | 211 out_apps->InsertAll(registry->disabled_extensions()); |
| 212 out_apps->InsertAll(registry->terminated_extensions()); | 212 out_apps->InsertAll(registry->terminated_extensions()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void AppListControllerDelegate::OnSearchStarted() { | 215 void AppListControllerDelegate::OnSearchStarted() { |
| 216 #if defined(ENABLE_RLZ) | 216 #if defined(ENABLE_RLZ) |
| 217 RLZTracker::RecordAppListSearch(); | 217 RLZTracker::RecordAppListSearch(); |
| 218 #endif | 218 #endif |
| 219 } | 219 } |
| OLD | NEW |