| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/startup/bad_flags_prompt.h" | 5 #include "chrome/browser/ui/startup/bad_flags_prompt.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // the flag is enabled. | 92 // the flag is enabled. |
| 93 switches::kEnableWebBluetooth, | 93 switches::kEnableWebBluetooth, |
| 94 | 94 |
| 95 NULL | 95 NULL |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 for (const char** flag = kBadFlags; *flag; ++flag) { | 98 for (const char** flag = kBadFlags; *flag; ++flag) { |
| 99 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { | 99 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { |
| 100 SimpleAlertInfoBarDelegate::Create( | 100 SimpleAlertInfoBarDelegate::Create( |
| 101 InfoBarService::FromWebContents(web_contents), | 101 InfoBarService::FromWebContents(web_contents), |
| 102 "BadFlagsPrompt", |
| 102 infobars::InfoBarDelegate::kNoIconID, | 103 infobars::InfoBarDelegate::kNoIconID, |
| 103 gfx::VectorIconId::VECTOR_ICON_NONE, | 104 gfx::VectorIconId::VECTOR_ICON_NONE, |
| 104 l10n_util::GetStringFUTF16( | 105 l10n_util::GetStringFUTF16( |
| 105 IDS_BAD_FLAGS_WARNING_MESSAGE, | 106 IDS_BAD_FLAGS_WARNING_MESSAGE, |
| 106 base::UTF8ToUTF16(std::string("--") + *flag)), | 107 base::UTF8ToUTF16(std::string("--") + *flag)), |
| 107 false); | 108 false); |
| 108 return; | 109 return; |
| 109 } | 110 } |
| 110 } | 111 } |
| 111 } | 112 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 136 user_data_dir.LossyDisplayName()); | 137 user_data_dir.LossyDisplayName()); |
| 137 | 138 |
| 138 if (cleanup_resource_bundle) | 139 if (cleanup_resource_bundle) |
| 139 ResourceBundle::CleanupSharedInstance(); | 140 ResourceBundle::CleanupSharedInstance(); |
| 140 | 141 |
| 141 // More complex dialogs cannot be shown before the earliest calls here. | 142 // More complex dialogs cannot be shown before the earliest calls here. |
| 142 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); | 143 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace chrome | 146 } // namespace chrome |
| OLD | NEW |