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/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "apps/metrics_names.h" | 11 #include "apps/metrics_names.h" |
12 #include "base/auto_reset.h" | 12 #include "base/auto_reset.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/bind_helpers.h" | 14 #include "base/bind_helpers.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/i18n/rtl.h" | 16 #include "base/i18n/rtl.h" |
17 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
19 #include "base/prefs/pref_service.h" | |
20 #include "base/prefs/scoped_user_pref_update.h" | |
21 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
22 #include "base/values.h" | 20 #include "base/values.h" |
23 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
24 #include "chrome/browser/chrome_notification_types.h" | 22 #include "chrome/browser/chrome_notification_types.h" |
25 #include "chrome/browser/extensions/crx_installer.h" | 23 #include "chrome/browser/extensions/crx_installer.h" |
26 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
27 #include "chrome/browser/extensions/extension_ui_util.h" | 25 #include "chrome/browser/extensions/extension_ui_util.h" |
28 #include "chrome/browser/extensions/launch_util.h" | 26 #include "chrome/browser/extensions/launch_util.h" |
29 #include "chrome/browser/favicon/favicon_service_factory.h" | 27 #include "chrome/browser/favicon/favicon_service_factory.h" |
30 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
(...skipping 12 matching lines...) Expand all Loading... |
43 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 41 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
44 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/extensions/extension_constants.h" | 43 #include "chrome/common/extensions/extension_constants.h" |
46 #include "chrome/common/extensions/extension_metrics.h" | 44 #include "chrome/common/extensions/extension_metrics.h" |
47 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 45 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
48 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
49 #include "chrome/common/url_constants.h" | 47 #include "chrome/common/url_constants.h" |
50 #include "chrome/common/web_application_info.h" | 48 #include "chrome/common/web_application_info.h" |
51 #include "chrome/grit/generated_resources.h" | 49 #include "chrome/grit/generated_resources.h" |
52 #include "components/favicon_base/favicon_types.h" | 50 #include "components/favicon_base/favicon_types.h" |
| 51 #include "components/prefs/pref_service.h" |
| 52 #include "components/prefs/scoped_user_pref_update.h" |
53 #include "content/public/browser/notification_service.h" | 53 #include "content/public/browser/notification_service.h" |
54 #include "content/public/browser/web_ui.h" | 54 #include "content/public/browser/web_ui.h" |
55 #include "content/public/common/favicon_url.h" | 55 #include "content/public/common/favicon_url.h" |
56 #include "extensions/browser/app_sorting.h" | 56 #include "extensions/browser/app_sorting.h" |
57 #include "extensions/browser/extension_prefs.h" | 57 #include "extensions/browser/extension_prefs.h" |
58 #include "extensions/browser/extension_registry.h" | 58 #include "extensions/browser/extension_registry.h" |
59 #include "extensions/browser/extension_system.h" | 59 #include "extensions/browser/extension_system.h" |
60 #include "extensions/browser/management_policy.h" | 60 #include "extensions/browser/management_policy.h" |
61 #include "extensions/browser/pref_names.h" | 61 #include "extensions/browser/pref_names.h" |
62 #include "extensions/browser/uninstall_reason.h" | 62 #include "extensions/browser/uninstall_reason.h" |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 base::FundamentalValue(!extension_id_prompting_.empty())); | 848 base::FundamentalValue(!extension_id_prompting_.empty())); |
849 } | 849 } |
850 | 850 |
851 bool AppLauncherHandler::ShouldShow(const Extension* extension) const { | 851 bool AppLauncherHandler::ShouldShow(const Extension* extension) const { |
852 if (ignore_changes_ || !has_loaded_apps_ || !extension->is_app()) | 852 if (ignore_changes_ || !has_loaded_apps_ || !extension->is_app()) |
853 return false; | 853 return false; |
854 | 854 |
855 Profile* profile = Profile::FromWebUI(web_ui()); | 855 Profile* profile = Profile::FromWebUI(web_ui()); |
856 return extensions::ui_util::ShouldDisplayInNewTabPage(extension, profile); | 856 return extensions::ui_util::ShouldDisplayInNewTabPage(extension, profile); |
857 } | 857 } |
OLD | NEW |