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

Unified Diff: chrome/browser/ui/views/session_crashed_bubble_view.cc

Issue 284113006: Enable new session crashed bubble UI by Finch experiment. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nit Created 6 years, 7 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/startup/startup_browser_creator_impl.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/session_crashed_bubble_view.cc
diff --git a/chrome/browser/ui/views/session_crashed_bubble_view.cc b/chrome/browser/ui/views/session_crashed_bubble_view.cc
index f5fcd30c60efc3476b75fa34f866513a8975e66c..beab995abf87207502e35a2ea0daa2201620dc88 100644
--- a/chrome/browser/ui/views/session_crashed_bubble_view.cc
+++ b/chrome/browser/ui/views/session_crashed_bubble_view.cc
@@ -6,6 +6,8 @@
#include <vector>
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
#include "base/prefs/pref_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -16,6 +18,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/installer/util/google_update_settings.h"
@@ -56,6 +59,10 @@ const int kMarginHeight = kMarginWidth;
const SkColor kLightGrayBackgroundColor = 0xFFF0F0F0;
const SkColor kWhiteBackgroundColor = 0xFFFFFFFF;
+// The Finch study name and group name that enables session crashed bubble UI.
+const char kEnableBubbleUIFinchName[] = "EnableSessionCrashedBubbleUI";
+const char kEnableBubbleUIGroupEnabled[] = "Enabled";
+
bool ShouldOfferMetricsReporting() {
// Stats collection only applies to Google Chrome builds.
#if defined(GOOGLE_CHROME_BUILD)
@@ -344,7 +351,17 @@ void SessionCrashedBubbleView::CloseBubble() {
GetWidget()->Close();
}
-bool ShowSessionCrashedBubble(Browser* browser) {
- SessionCrashedBubbleView::Show(browser);
- return true;
+bool ShowSessionCrashedBubble(Browser* browser,
+ const base::CommandLine& command_line) {
Alexei Svitkine (slow) 2014/05/15 22:52:27 I don't think you need this param. You can just do
yao 2014/05/16 00:48:25 I can't until the other CL (with posttask schedule
Alexei Svitkine (slow) 2014/05/16 19:01:40 I think you can just wait for the other CL to land
yao 2014/05/26 21:36:50 Done.
+ // If user disables the bubble UI explicitly, don't show it. If not, the
+ // bubble UI can be enabled by Finch experiment or by flag.
+ if (command_line.HasSwitch(switches::kDisableSessionCrashedBubble)) {
+ return false;
Alexei Svitkine (slow) 2014/05/16 19:01:40 No need for else or {}'s if you're doing a return
yao 2014/05/26 21:36:50 Done.
+ } else if (base::FieldTrialList::FindFullName(kEnableBubbleUIFinchName) ==
Alexei Svitkine (slow) 2014/05/16 19:01:40 The best practice for this is to get the group fir
yao 2014/05/26 21:36:50 Done.
+ kEnableBubbleUIGroupEnabled ||
+ command_line.HasSwitch(switches::kEnableSessionCrashedBubble)) {
+ SessionCrashedBubbleView::Show(browser);
+ return true;
+ }
+ return false;
}
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698