Commit c20eefa8 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Move Captive Portal Metrics logging behind a flag.

Metrics logged from the CaptivePortalMetricsTabHelper are useful to
determine the users affected by a broken connection due to a Captive
Portal. However, it is not necessary to log these metrics continuously.
Keeping the tab helper behind a flag allows re-enabling the metrics in
the future in order to examine the issues caused by Captive Portals.

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I8c4fca02d85701ca1ef1b7bf0aec87cf08015bd0
Reviewed-on: https://chromium-review.googlesource.com/924571
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537845}
parent a2358ce5
......@@ -150,6 +150,9 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
{"ios-captive-portal", flag_descriptions::kCaptivePortalName,
flag_descriptions::kCaptivePortalDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kCaptivePortalFeature)},
{"ios-captive-portal-metrics", flag_descriptions::kCaptivePortalMetricsName,
flag_descriptions::kCaptivePortalMetricsDescription, flags_ui::kOsIos,
FEATURE_VALUE_TYPE(kCaptivePortalMetrics)},
{"in-product-help-demo-mode-choice",
flag_descriptions::kInProductHelpDemoModeName,
flag_descriptions::kInProductHelpDemoModeDescription, flags_ui::kOsIos,
......
......@@ -20,6 +20,11 @@ const char kCaptivePortalDescription[] =
"When enabled, the Captive Portal landing page will be displayed if it is "
"detected that the user is connected to a Captive Portal network.";
const char kCaptivePortalMetricsName[] = "Captive Portal Metrics";
const char kCaptivePortalMetricsDescription[] =
"When enabled, some network issues will trigger a test to check if a "
"Captive Portal network is the cause of the issue.";
const char kClippingTextfieldName[] = "Clipping Textfield";
const char kClippingTextfieldDescription[] =
"When enabled, the new URL clipping implementation compatible with iOS 11 "
......
......@@ -16,6 +16,10 @@ extern const char kBrowserTaskSchedulerDescription[];
extern const char kCaptivePortalName[];
extern const char kCaptivePortalDescription[];
// Title and description for the flag to enable Captive Portal metrics logging.
extern const char kCaptivePortalMetricsName[];
extern const char kCaptivePortalMetricsDescription[];
// Title and description for the flag to enable Omnibox Clipping.
extern const char kClippingTextfieldName[];
extern const char kClippingTextfieldDescription[];
......
......@@ -6,3 +6,6 @@
const base::Feature kCaptivePortalFeature{"CaptivePortalFeature",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCaptivePortalMetrics{"CaptivePortalMetrics",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -10,4 +10,7 @@
// Used to control the state of the Captive Portal Login feature.
extern const base::Feature kCaptivePortalFeature;
// Used to control the state of logging Captive Portal Metrics.
extern const base::Feature kCaptivePortalMetrics;
#endif // IOS_CHROME_BROWSER_SSL_CAPTIVE_PORTAL_FEATURES_H_
......@@ -109,6 +109,7 @@ source_set("tabs_internal") {
"//ios/chrome/browser/sessions:serialisation",
"//ios/chrome/browser/snapshots",
"//ios/chrome/browser/ssl",
"//ios/chrome/browser/ssl:features",
"//ios/chrome/browser/store_kit",
"//ios/chrome/browser/sync",
"//ios/chrome/browser/translate",
......
......@@ -8,6 +8,7 @@
#error "This file requires ARC support."
#endif
#include "base/feature_list.h"
#import "components/favicon/ios/web_favicon_driver.h"
#include "components/history/core/browser/top_sites.h"
#import "components/history/ios/browser/web_state_top_sites_observer.h"
......@@ -28,6 +29,7 @@
#import "ios/chrome/browser/reading_list/reading_list_web_state_observer.h"
#import "ios/chrome/browser/sessions/ios_chrome_session_tab_helper.h"
#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h"
#include "ios/chrome/browser/ssl/captive_portal_features.h"
#import "ios/chrome/browser/ssl/captive_portal_metrics_tab_helper.h"
#import "ios/chrome/browser/ssl/insecure_input_tab_helper.h"
#import "ios/chrome/browser/ssl/ios_security_state_tab_helper.h"
......@@ -77,7 +79,10 @@ void AttachTabHelpers(web::WebState* web_state, bool for_prerender) {
StoreKitTabHelper::CreateForWebState(web_state);
HistoryTabHelper::CreateForWebState(web_state);
LoadTimingTabHelper::CreateForWebState(web_state);
CaptivePortalMetricsTabHelper::CreateForWebState(web_state);
if (base::FeatureList::IsEnabled(kCaptivePortalMetrics)) {
CaptivePortalMetricsTabHelper::CreateForWebState(web_state);
}
ReadingListModel* model =
ReadingListModelFactory::GetForBrowserState(browser_state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment