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 "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/simple_message_box.h" | 13 #include "chrome/browser/ui/simple_message_box.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/switch_utils.h" | 17 #include "chrome/common/switch_utils.h" |
18 #include "chrome/grit/chromium_strings.h" | 18 #include "chrome/grit/chromium_strings.h" |
19 #include "chrome/grit/generated_resources.h" | 19 #include "chrome/grit/generated_resources.h" |
20 #include "components/autofill/core/common/autofill_switches.h" | 20 #include "components/autofill/core/common/autofill_switches.h" |
| 21 #include "components/infobars/core/infobar_delegate.h" |
21 #include "components/infobars/core/simple_alert_infobar_delegate.h" | 22 #include "components/infobars/core/simple_alert_infobar_delegate.h" |
22 #include "components/invalidation/impl/invalidation_switches.h" | 23 #include "components/invalidation/impl/invalidation_switches.h" |
23 #include "components/nacl/common/nacl_switches.h" | 24 #include "components/nacl/common/nacl_switches.h" |
24 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 25 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
25 #include "components/translate/core/common/translate_switches.h" | 26 #include "components/translate/core/common/translate_switches.h" |
26 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
27 #include "extensions/common/switches.h" | 28 #include "extensions/common/switches.h" |
28 #include "google_apis/gaia/gaia_switches.h" | 29 #include "google_apis/gaia/gaia_switches.h" |
29 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // the flag is enabled. | 94 // the flag is enabled. |
94 switches::kEnableWebBluetooth, | 95 switches::kEnableWebBluetooth, |
95 | 96 |
96 NULL | 97 NULL |
97 }; | 98 }; |
98 | 99 |
99 for (const char** flag = kBadFlags; *flag; ++flag) { | 100 for (const char** flag = kBadFlags; *flag; ++flag) { |
100 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { | 101 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { |
101 SimpleAlertInfoBarDelegate::Create( | 102 SimpleAlertInfoBarDelegate::Create( |
102 InfoBarService::FromWebContents(web_contents), | 103 InfoBarService::FromWebContents(web_contents), |
| 104 infobars::InfoBarDelegate::BAD_FLAGS_PROMPT, |
103 infobars::InfoBarDelegate::kNoIconID, | 105 infobars::InfoBarDelegate::kNoIconID, |
104 gfx::VectorIconId::VECTOR_ICON_NONE, | 106 gfx::VectorIconId::VECTOR_ICON_NONE, |
105 l10n_util::GetStringFUTF16( | 107 l10n_util::GetStringFUTF16( |
106 IDS_BAD_FLAGS_WARNING_MESSAGE, | 108 IDS_BAD_FLAGS_WARNING_MESSAGE, |
107 base::UTF8ToUTF16(std::string("--") + *flag)), | 109 base::UTF8ToUTF16(std::string("--") + *flag)), |
108 false); | 110 false); |
109 return; | 111 return; |
110 } | 112 } |
111 } | 113 } |
112 } | 114 } |
(...skipping 24 matching lines...) Expand all Loading... |
137 user_data_dir.LossyDisplayName()); | 139 user_data_dir.LossyDisplayName()); |
138 | 140 |
139 if (cleanup_resource_bundle) | 141 if (cleanup_resource_bundle) |
140 ResourceBundle::CleanupSharedInstance(); | 142 ResourceBundle::CleanupSharedInstance(); |
141 | 143 |
142 // More complex dialogs cannot be shown before the earliest calls here. | 144 // More complex dialogs cannot be shown before the earliest calls here. |
143 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); | 145 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); |
144 } | 146 } |
145 | 147 |
146 } // namespace chrome | 148 } // namespace chrome |
OLD | NEW |