OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" | 5 #include "chrome/browser/ui/views/session_crashed_bubble_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 | 412 |
413 void SessionCrashedBubbleView::RestorePreviousSession(views::Button* sender) { | 413 void SessionCrashedBubbleView::RestorePreviousSession(views::Button* sender) { |
414 SessionRestore::RestoreSessionAfterCrash(browser_); | 414 SessionRestore::RestoreSessionAfterCrash(browser_); |
415 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED); | 415 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED); |
416 restored_ = true; | 416 restored_ = true; |
417 | 417 |
418 // Record user's choice for opting in to UMA. | 418 // Record user's choice for opting in to UMA. |
419 // There's no opting-out choice in the crash restore bubble. | 419 // There's no opting-out choice in the crash restore bubble. |
420 if (uma_option_ && uma_option_->checked()) { | 420 if (uma_option_ && uma_option_->checked()) { |
421 // TODO: Clean up function ResolveMetricsReportingEnabled so that user pref | 421 base::Callback<void(bool)> callback_fn; |
422 // is stored automatically. | 422 InitiateMetricsReportingChange(callback_fn, true); |
423 ResolveMetricsReportingEnabled(true); | |
424 g_browser_process->local_state()->SetBoolean( | |
425 prefs::kMetricsReportingEnabled, true); | |
426 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); | 423 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); |
427 } | 424 } |
428 CloseBubble(); | 425 CloseBubble(); |
429 } | 426 } |
430 | 427 |
431 void SessionCrashedBubbleView::CloseBubble() { | 428 void SessionCrashedBubbleView::CloseBubble() { |
432 GetWidget()->Close(); | 429 GetWidget()->Close(); |
433 } | 430 } |
434 | 431 |
435 bool ShowSessionCrashedBubble(Browser* browser) { | 432 bool ShowSessionCrashedBubble(Browser* browser) { |
436 if (IsBubbleUIEnabled()) { | 433 if (IsBubbleUIEnabled()) { |
437 SessionCrashedBubbleView::Show(browser); | 434 SessionCrashedBubbleView::Show(browser); |
438 return true; | 435 return true; |
439 } | 436 } |
440 return false; | 437 return false; |
441 } | 438 } |
OLD | NEW |