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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 } | 416 } |
417 | 417 |
418 void SessionCrashedBubbleView::RestorePreviousSession(views::Button* sender) { | 418 void SessionCrashedBubbleView::RestorePreviousSession(views::Button* sender) { |
419 SessionRestore::RestoreSessionAfterCrash(browser_); | 419 SessionRestore::RestoreSessionAfterCrash(browser_); |
420 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED); | 420 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED); |
421 restored_ = true; | 421 restored_ = true; |
422 | 422 |
423 // Record user's choice for opting in to UMA. | 423 // Record user's choice for opting in to UMA. |
424 // There's no opting-out choice in the crash restore bubble. | 424 // There's no opting-out choice in the crash restore bubble. |
425 if (uma_option_ && uma_option_->checked()) { | 425 if (uma_option_ && uma_option_->checked()) { |
426 // TODO: Clean up function ResolveMetricsReportingEnabled so that user pref | 426 base::Callback<void(bool)> callback_fn; |
427 // is stored automatically. | 427 InitiateMetricsReportingChange(true, callback_fn); |
428 ResolveMetricsReportingEnabled(true); | |
429 g_browser_process->local_state()->SetBoolean( | |
430 prefs::kMetricsReportingEnabled, true); | |
431 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); | 428 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); |
432 } | 429 } |
433 CloseBubble(); | 430 CloseBubble(); |
434 } | 431 } |
435 | 432 |
436 void SessionCrashedBubbleView::CloseBubble() { | 433 void SessionCrashedBubbleView::CloseBubble() { |
437 GetWidget()->Close(); | 434 GetWidget()->Close(); |
438 } | 435 } |
439 | 436 |
440 bool ShowSessionCrashedBubble(Browser* browser) { | 437 bool ShowSessionCrashedBubble(Browser* browser) { |
441 if (IsBubbleUIEnabled()) { | 438 if (IsBubbleUIEnabled()) { |
442 SessionCrashedBubbleView::Show(browser); | 439 SessionCrashedBubbleView::Show(browser); |
443 return true; | 440 return true; |
444 } | 441 } |
445 return false; | 442 return false; |
446 } | 443 } |
OLD | NEW |