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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 Browser* browser_; | 127 Browser* browser_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(BrowserRemovalObserver); | 129 DISALLOW_COPY_AND_ASSIGN(BrowserRemovalObserver); |
130 }; | 130 }; |
131 | 131 |
132 // static | 132 // static |
133 bool SessionCrashedBubbleView::Show(Browser* browser) { | 133 bool SessionCrashedBubbleView::Show(Browser* browser) { |
134 if (!IsBubbleUIEnabled()) | 134 if (!IsBubbleUIEnabled()) |
135 return false; | 135 return false; |
136 | 136 |
137 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 137 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
138 if (browser->profile()->IsOffTheRecord()) | 138 if (browser->profile()->IsOffTheRecord()) |
139 return true; | 139 return true; |
140 | 140 |
141 // Observes browser removal event and will be deallocated in ShowForReal. | 141 // Observes browser removal event and will be deallocated in ShowForReal. |
142 scoped_ptr<BrowserRemovalObserver> browser_observer( | 142 scoped_ptr<BrowserRemovalObserver> browser_observer( |
143 new BrowserRemovalObserver(browser)); | 143 new BrowserRemovalObserver(browser)); |
144 | 144 |
145 // Stats collection only applies to Google Chrome builds. | 145 // Stats collection only applies to Google Chrome builds. |
146 #if defined(GOOGLE_CHROME_BUILD) | 146 #if defined(GOOGLE_CHROME_BUILD) |
147 // Schedule a task to run GoogleUpdateSettings::GetCollectStatsConsent() on | 147 // Schedule a task to run GoogleUpdateSettings::GetCollectStatsConsent() on |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 if (uma_option_ && uma_option_->checked()) { | 442 if (uma_option_ && uma_option_->checked()) { |
443 InitiateMetricsReportingChange(true, OnMetricsReportingCallbackType()); | 443 InitiateMetricsReportingChange(true, OnMetricsReportingCallbackType()); |
444 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); | 444 RecordBubbleHistogramValue(SESSION_CRASHED_BUBBLE_UMA_OPTIN); |
445 } | 445 } |
446 CloseBubble(); | 446 CloseBubble(); |
447 } | 447 } |
448 | 448 |
449 void SessionCrashedBubbleView::CloseBubble() { | 449 void SessionCrashedBubbleView::CloseBubble() { |
450 GetWidget()->Close(); | 450 GetWidget()->Close(); |
451 } | 451 } |
OLD | NEW |