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

Side by Side Diff: chrome/browser/ui/views/session_crashed_bubble_view.cc

Issue 2714483003: cros: Fix restoring session windows after crash inconsistent minimized window counts (Closed)
Patch Set: RestoreSessionAfterCrash on nullptr Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/sessions/session_restore_browsertest_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 ui::PAGE_TRANSITION_LINK, false)); 315 ui::PAGE_TRANSITION_LINK, false));
316 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_HELP); 316 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_HELP);
317 } 317 }
318 318
319 void SessionCrashedBubbleView::RestorePreviousSession() { 319 void SessionCrashedBubbleView::RestorePreviousSession() {
320 ignored_ = false; 320 ignored_ = false;
321 MaybeEnableUMA(); 321 MaybeEnableUMA();
322 CloseBubble(); 322 CloseBubble();
323 323
324 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED); 324 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_RESTORED);
325 // Restoring tabs has side effects, so it's preferable to do it after the
326 // bubble was closed.
327 SessionRestore::RestoreSessionAfterCrash(browser_); 325 SessionRestore::RestoreSessionAfterCrash(browser_);
328 } 326 }
329 327
330 void SessionCrashedBubbleView::OpenStartupPages() { 328 void SessionCrashedBubbleView::OpenStartupPages() {
331 ignored_ = false; 329 ignored_ = false;
332 MaybeEnableUMA(); 330 MaybeEnableUMA();
333 CloseBubble(); 331 CloseBubble();
334 332
335 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_STARTUP_PAGES); 333 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_STARTUP_PAGES);
336 // Opening tabs has side effects, so it's preferable to do it after the bubble 334 // Opening tabs has side effects, so it's preferable to do it after the bubble
337 // was closed. 335 // was closed.
338 SessionRestore::OpenStartupPagesAfterCrash(browser_); 336 SessionRestore::OpenStartupPagesAfterCrash(browser_);
339 } 337 }
340 338
341 void SessionCrashedBubbleView::MaybeEnableUMA() { 339 void SessionCrashedBubbleView::MaybeEnableUMA() {
342 // Record user's choice for opt-in in to UMA. 340 // Record user's choice for opt-in in to UMA.
343 // There's no opt-out choice in the crash restore bubble. 341 // There's no opt-out choice in the crash restore bubble.
344 if (uma_option_ && uma_option_->checked()) { 342 if (uma_option_ && uma_option_->checked()) {
345 ChangeMetricsReportingState(true); 343 ChangeMetricsReportingState(true);
346 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); 344 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN);
347 } 345 }
348 } 346 }
349 347
350 void SessionCrashedBubbleView::CloseBubble() { 348 void SessionCrashedBubbleView::CloseBubble() {
351 GetWidget()->Close(); 349 GetWidget()->Close();
352 } 350 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_restore_browsertest_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698