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

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

Issue 2656213002: Makes SessionCrashedBubbleView work on chromeos (Closed)
Patch Set: consent works on chromeos Created 3 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/views/frame/browser_view.cc ('k') | chrome/test/BUILD.gn » ('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 3278d7cf1a75a51741421a46c3f74a9f36d48c4c..5fd54eb14870db20794635737b55f368eb2f219e 100644
--- a/chrome/browser/ui/views/session_crashed_bubble_view.cc
+++ b/chrome/browser/ui/views/session_crashed_bubble_view.cc
@@ -71,16 +71,11 @@ void RecordBubbleHistogramValue(SessionCrashedBubbleHistogramValue value) {
"SessionCrashed.Bubble", value, SESSION_CRASHED_BUBBLE_MAX);
}
-// Whether or not the bubble UI should be used.
-// TODO(crbug.com/653966): Enable this on all desktop platforms.
-bool IsBubbleUIEnabled() {
-// Function ChangeMetricsReportingState (called when the user chooses to
-// opt-in to UMA) does not support Chrome OS yet, so don't show the bubble on
-// Chrome OS.
-#if defined(OS_CHROMEOS)
- return false;
-#else
+bool DoesSupportConsentCheck() {
+#if defined(GOOGLE_CHROME_BUILD)
return true;
+#else
+ return false;
#endif
}
@@ -113,9 +108,6 @@ class SessionCrashedBubbleView::BrowserRemovalObserver
// static
bool SessionCrashedBubble::Show(Browser* browser) {
- if (!IsBubbleUIEnabled())
- return false;
-
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (browser->profile()->IsOffTheRecord())
return true;
@@ -125,21 +117,18 @@ bool SessionCrashedBubble::Show(Browser* browser) {
browser_observer(
new SessionCrashedBubbleView::BrowserRemovalObserver(browser));
-// Stats collection only applies to Google Chrome builds.
-#if defined(GOOGLE_CHROME_BUILD)
- // Schedule a task to run GoogleUpdateSettings::GetCollectStatsConsent() on
- // FILE thread, since it does IO. Then, call
- // SessionCrashedBubbleView::ShowForReal with the result.
- content::BrowserThread::PostTaskAndReplyWithResult(
- content::BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&GoogleUpdateSettings::GetCollectStatsConsent),
- base::Bind(&SessionCrashedBubbleView::ShowForReal,
- base::Passed(&browser_observer)));
-#else
- SessionCrashedBubbleView::ShowForReal(std::move(browser_observer), false);
-#endif // defined(GOOGLE_CHROME_BUILD)
-
+ if (DoesSupportConsentCheck()) {
+ // Schedule a task to run GoogleUpdateSettings::GetCollectStatsConsent() on
+ // FILE thread, since it does IO. Then, call
+ // SessionCrashedBubbleView::ShowForReal with the result.
+ content::BrowserThread::PostTaskAndReplyWithResult(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(&GoogleUpdateSettings::GetCollectStatsConsent),
+ base::Bind(&SessionCrashedBubbleView::ShowForReal,
+ base::Passed(&browser_observer)));
+ } else {
+ SessionCrashedBubbleView::ShowForReal(std::move(browser_observer), false);
+ }
return true;
}
@@ -152,10 +141,8 @@ void SessionCrashedBubbleView::ShowForReal(
// and the preference is modifiable by the user.
bool offer_uma_optin = false;
-#if defined(GOOGLE_CHROME_BUILD)
- if (!uma_opted_in_already)
+ if (DoesSupportConsentCheck() && !uma_opted_in_already)
offer_uma_optin = !IsMetricsReportingPolicyManaged();
-#endif // defined(GOOGLE_CHROME_BUILD)
Browser* browser = browser_observer->browser();
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698