OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/banners/app_banner_manager_desktop.h" | 5 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" | 10 #include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" |
11 #include "chrome/browser/banners/app_banner_metrics.h" | 11 #include "chrome/browser/banners/app_banner_metrics.h" |
12 #include "chrome/browser/banners/app_banner_settings_helper.h" | 12 #include "chrome/browser/banners/app_banner_settings_helper.h" |
13 #include "chrome/browser/extensions/bookmark_app_helper.h" | 13 #include "chrome/browser/extensions/bookmark_app_helper.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/chrome_features.h" | 15 #include "chrome/common/chrome_features.h" |
16 #include "chrome/common/web_application_info.h" | 16 #include "chrome/common/web_application_info.h" |
17 #include "extensions/common/constants.h" | 17 #include "extensions/common/constants.h" |
18 | 18 |
19 DEFINE_WEB_CONTENTS_USER_DATA_KEY(banners::AppBannerManagerDesktop); | 19 DEFINE_WEB_CONTENTS_USER_DATA_KEY(banners::AppBannerManagerDesktop); |
20 | 20 |
21 namespace banners { | 21 namespace banners { |
22 | 22 |
23 bool AppBannerManagerDesktop::IsEnabled() { | 23 bool AppBannerManagerDesktop::IsEnabled() { |
24 return base::FeatureList::IsEnabled(features::kAppBanners); | 24 return base::FeatureList::IsEnabled(features::kAppBanners) || |
| 25 base::FeatureList::IsEnabled(features::kExperimentalAppBanners); |
25 } | 26 } |
26 | 27 |
27 AppBannerManagerDesktop::AppBannerManagerDesktop( | 28 AppBannerManagerDesktop::AppBannerManagerDesktop( |
28 content::WebContents* web_contents) | 29 content::WebContents* web_contents) |
29 : AppBannerManager(web_contents) { } | 30 : AppBannerManager(web_contents) { } |
30 | 31 |
31 AppBannerManagerDesktop::~AppBannerManagerDesktop() { } | 32 AppBannerManagerDesktop::~AppBannerManagerDesktop() { } |
32 | 33 |
33 void AppBannerManagerDesktop::DidFinishCreatingBookmarkApp( | 34 void AppBannerManagerDesktop::DidFinishCreatingBookmarkApp( |
34 const extensions::Extension* extension, | 35 const extensions::Extension* extension, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 double score) { | 101 double score) { |
101 // Explicitly forbid banners from triggering on navigation unless this is | 102 // Explicitly forbid banners from triggering on navigation unless this is |
102 // enabled. | 103 // enabled. |
103 if (!IsEnabled()) | 104 if (!IsEnabled()) |
104 return; | 105 return; |
105 | 106 |
106 AppBannerManager::OnEngagementIncreased(web_contents, url, score); | 107 AppBannerManager::OnEngagementIncreased(web_contents, url, score); |
107 } | 108 } |
108 | 109 |
109 } // namespace banners | 110 } // namespace banners |
OLD | NEW |