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

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: Address comments 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 27110432f2c7a7b1330f8f3c1ffa4af7e1a2a252..98700b179fb7a2d855827cce156e128dcbe6d835 100644
--- a/chrome/browser/ui/views/session_crashed_bubble_view.cc
+++ b/chrome/browser/ui/views/session_crashed_bubble_view.cc
@@ -8,6 +8,8 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#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"
@@ -20,6 +22,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"
@@ -61,6 +64,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)
@@ -74,6 +81,18 @@ bool ShouldOfferMetricsReporting() {
#endif // defined(GOOGLE_CHROME_BUILD)
}
+// Whether or not the bubble UI should be used.
+bool IsBubbleUIEnabled() {
+ const std::string group_name = base::FieldTrialList::FindFullName(
+ kEnableBubbleUIFinchName);
+ const base::CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kDisableSessionCrashedBubble))
+ return false;
+ if (command_line.HasSwitch(switches::kEnableSessionCrashedBubble))
+ return true;
+ return group_name == kEnableBubbleUIGroupEnabled;
+}
+
} // namespace
// A helper class that listens to browser removal event.
@@ -417,6 +436,9 @@ void SessionCrashedBubbleView::CloseBubble() {
}
bool ShowSessionCrashedBubble(Browser* browser) {
- SessionCrashedBubbleView::Show(browser);
- return true;
+ if (IsBubbleUIEnabled()) {
+ 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