Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1251)

Unified Diff: chrome/browser/ui/website_settings/permission_bubble_manager.cc

Issue 791033004: Control permission bubbles with Finch flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Default to false Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/website_settings/permission_bubble_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/website_settings/permission_bubble_manager.cc
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.cc b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
index 4a64dae46e13957d0ae08ca686879b4213d6a598..b8d26d5a1882a3d93349eac362d03aef1586da36 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.cc
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/user_metrics_action.h"
#include "chrome/browser/ui/website_settings/permission_bubble_request.h"
#include "chrome/common/chrome_switches.h"
@@ -14,6 +15,11 @@
namespace {
+// String constants to control whether bubbles are enabled by default.
+const char kTrialName[] = "PermissionBubbleRollout";
+const char kEnabled[] = "Enabled";
+const char kDisabled[] = "Disabled";
+
class CancelledRequest : public PermissionBubbleRequest {
public:
explicit CancelledRequest(PermissionBubbleRequest* cancelled)
@@ -53,14 +59,20 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(PermissionBubbleManager);
// static
bool PermissionBubbleManager::Enabled() {
+ // Command line flags take precedence.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnablePermissionsBubbles))
return true;
-
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePermissionsBubbles))
return false;
+ std::string group(base::FieldTrialList::FindFullName(kTrialName));
+ if (group == kEnabled)
+ return true;
+ if (group == kDisabled)
+ return false;
+
return false;
}
« no previous file with comments | « chrome/browser/ui/website_settings/permission_bubble_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698