| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 84 } |
| 85 | 85 |
| 86 // Whether or not the bubble UI should be used. | 86 // Whether or not the bubble UI should be used. |
| 87 bool IsBubbleUIEnabled() { | 87 bool IsBubbleUIEnabled() { |
| 88 // Function InitiateMetricsReportingChange (called when the user chooses to | 88 // Function InitiateMetricsReportingChange (called when the user chooses to |
| 89 // opt-in to UMA) does not support Chrome OS yet, so don't show the bubble on | 89 // opt-in to UMA) does not support Chrome OS yet, so don't show the bubble on |
| 90 // Chrome OS. | 90 // Chrome OS. |
| 91 #if defined(OS_CHROMEOS) | 91 #if defined(OS_CHROMEOS) |
| 92 return false; | 92 return false; |
| 93 #else | 93 #else |
| 94 const base::CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 94 const base::CommandLine& command_line = |
| 95 *base::CommandLine::ForCurrentProcess(); |
| 95 if (command_line.HasSwitch(switches::kDisableSessionCrashedBubble)) | 96 if (command_line.HasSwitch(switches::kDisableSessionCrashedBubble)) |
| 96 return false; | 97 return false; |
| 97 if (command_line.HasSwitch(switches::kEnableSessionCrashedBubble)) | 98 if (command_line.HasSwitch(switches::kEnableSessionCrashedBubble)) |
| 98 return true; | 99 return true; |
| 99 const std::string group_name = base::FieldTrialList::FindFullName( | 100 const std::string group_name = base::FieldTrialList::FindFullName( |
| 100 kEnableBubbleUIFinchName); | 101 kEnableBubbleUIFinchName); |
| 101 return group_name != kEnableBubbleUIGroupDisabled; | 102 return group_name != kEnableBubbleUIGroupDisabled; |
| 102 #endif | 103 #endif |
| 103 } | 104 } |
| 104 | 105 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 GetWidget()->Close(); | 446 GetWidget()->Close(); |
| 446 } | 447 } |
| 447 | 448 |
| 448 bool ShowSessionCrashedBubble(Browser* browser) { | 449 bool ShowSessionCrashedBubble(Browser* browser) { |
| 449 if (IsBubbleUIEnabled()) { | 450 if (IsBubbleUIEnabled()) { |
| 450 SessionCrashedBubbleView::Show(browser); | 451 SessionCrashedBubbleView::Show(browser); |
| 451 return true; | 452 return true; |
| 452 } | 453 } |
| 453 return false; | 454 return false; |
| 454 } | 455 } |
| OLD | NEW |