OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_settings_helper.h" | 5 #include "chrome/browser/banners/app_banner_settings_helper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "base/metrics/field_trial.h" | 15 #include "base/metrics/field_trial.h" |
16 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
18 #include "chrome/browser/banners/app_banner_manager.h" | 18 #include "chrome/browser/banners/app_banner_manager.h" |
19 #include "chrome/browser/banners/app_banner_metrics.h" | 19 #include "chrome/browser/banners/app_banner_metrics.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 21 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
22 #include "chrome/browser/installable/installable_logging.h" | 22 #include "chrome/browser/installable/installable_logging.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "components/content_settings/core/browser/host_content_settings_map.h" | 25 #include "components/content_settings/core/browser/host_content_settings_map.h" |
26 #include "components/content_settings/core/common/content_settings_pattern.h" | 26 #include "components/content_settings/core/common/content_settings_pattern.h" |
27 #include "components/rappor/rappor_utils.h" | 27 #include "components/rappor/public/rappor_utils.h" |
| 28 #include "components/rappor/rappor_service_impl.h" |
28 #include "components/variations/variations_associated_data.h" | 29 #include "components/variations/variations_associated_data.h" |
29 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
30 #include "net/base/escape.h" | 31 #include "net/base/escape.h" |
31 #include "url/gurl.h" | 32 #include "url/gurl.h" |
32 | 33 |
33 namespace { | 34 namespace { |
34 | 35 |
35 // Max number of apps (including ServiceWorker based web apps) that a particular | 36 // Max number of apps (including ServiceWorker based web apps) that a particular |
36 // site may show a banner for. | 37 // site may show a banner for. |
37 const size_t kMaxAppsPerSite = 3; | 38 const size_t kMaxAppsPerSite = 3; |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 return true; | 697 return true; |
697 } | 698 } |
698 | 699 |
699 // Assume any value which is not "0" or "false" indicates that we should use | 700 // Assume any value which is not "0" or "false" indicates that we should use |
700 // site engagement. | 701 // site engagement. |
701 std::string param = variations::GetVariationParamValue( | 702 std::string param = variations::GetVariationParamValue( |
702 kBannerParamsKey, kBannerSiteEngagementParamsKey); | 703 kBannerParamsKey, kBannerSiteEngagementParamsKey); |
703 | 704 |
704 return (!param.empty() && param != "0" && param != "false"); | 705 return (!param.empty() && param != "0" && param != "false"); |
705 } | 706 } |
OLD | NEW |