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" |
11 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" | 11 #include "chrome/browser/infobars/simple_alert_infobar_delegate.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 "components/nacl/common/nacl_switches.h" |
18 #include "components/startup_metric_utils/startup_metric_utils.h" | 19 #include "components/startup_metric_utils/startup_metric_utils.h" |
19 #include "components/translate/core/common/translate_switches.h" | 20 #include "components/translate/core/common/translate_switches.h" |
20 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
21 #include "extensions/common/switches.h" | 22 #include "extensions/common/switches.h" |
22 #include "google_apis/gaia/gaia_switches.h" | 23 #include "google_apis/gaia/gaia_switches.h" |
23 #include "grit/chromium_strings.h" | 24 #include "grit/chromium_strings.h" |
24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
27 | 28 |
28 namespace chrome { | 29 namespace chrome { |
29 | 30 |
30 void ShowBadFlagsPrompt(Browser* browser) { | 31 void ShowBadFlagsPrompt(Browser* browser) { |
31 content::WebContents* web_contents = | 32 content::WebContents* web_contents = |
32 browser->tab_strip_model()->GetActiveWebContents(); | 33 browser->tab_strip_model()->GetActiveWebContents(); |
33 if (!web_contents) | 34 if (!web_contents) |
34 return; | 35 return; |
35 | 36 |
36 // Unsupported flags for which to display a warning that "stability and | 37 // Unsupported flags for which to display a warning that "stability and |
37 // security will suffer". | 38 // security will suffer". |
38 static const char* kBadFlags[] = { | 39 static const char* kBadFlags[] = { |
39 // These flags disable sandbox-related security. | 40 // These flags disable sandbox-related security. |
40 switches::kDisableGpuSandbox, | 41 switches::kDisableGpuSandbox, |
41 switches::kDisableSeccompFilterSandbox, | 42 switches::kDisableSeccompFilterSandbox, |
42 switches::kDisableSetuidSandbox, | 43 switches::kDisableSetuidSandbox, |
43 switches::kDisableWebSecurity, | 44 switches::kDisableWebSecurity, |
| 45 switches::kNaClDangerousNoSandboxNonSfi, |
44 switches::kNoSandbox, | 46 switches::kNoSandbox, |
45 switches::kSingleProcess, | 47 switches::kSingleProcess, |
46 | 48 |
47 // These flags disable or undermine the Same Origin Policy. | 49 // These flags disable or undermine the Same Origin Policy. |
48 switches::kEnableBrowserPluginForAllViewTypes, | 50 switches::kEnableBrowserPluginForAllViewTypes, |
49 switches::kTrustedSpdyProxy, | 51 switches::kTrustedSpdyProxy, |
50 translate::switches::kTranslateSecurityOrigin, | 52 translate::switches::kTranslateSecurityOrigin, |
51 | 53 |
52 // These flags undermine HTTPS / connection security. | 54 // These flags undermine HTTPS / connection security. |
53 switches::kDisableUserMediaSecurity, | 55 switches::kDisableUserMediaSecurity, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 user_data_dir.LossyDisplayName()); | 115 user_data_dir.LossyDisplayName()); |
114 | 116 |
115 if (cleanup_resource_bundle) | 117 if (cleanup_resource_bundle) |
116 ResourceBundle::CleanupSharedInstance(); | 118 ResourceBundle::CleanupSharedInstance(); |
117 | 119 |
118 // More complex dialogs cannot be shown before the earliest calls here. | 120 // More complex dialogs cannot be shown before the earliest calls here. |
119 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); | 121 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); |
120 } | 122 } |
121 | 123 |
122 } // namespace chrome | 124 } // namespace chrome |
OLD | NEW |