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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" |
10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
16 | 16 |
17 namespace chrome { | 17 namespace chrome { |
18 | 18 |
19 void ShowBadFlagsPrompt(Browser* browser) { | 19 void ShowBadFlagsPrompt(Browser* browser) { |
20 // Unsupported flags for which to display a warning that "stability and | 20 // Unsupported flags for which to display a warning that "stability and |
21 // security will suffer". | 21 // security will suffer". |
22 static const char* kBadFlags[] = { | 22 static const char* kBadFlags[] = { |
23 // These imply disabling the sandbox. | 23 // These imply disabling the sandbox. |
24 switches::kSingleProcess, | 24 switches::kSingleProcess, |
25 switches::kNoSandbox, | 25 switches::kNoSandbox, |
26 switches::kInProcessWebGL, | 26 switches::kInProcessWebGL, |
27 switches::kDisableWebSecurity, | 27 switches::kDisableWebSecurity, |
| 28 switches::kAllowUniversalAccessFromFiles, |
28 // Browser plugin is dangerous on regular pages because it breaks the Same | 29 // Browser plugin is dangerous on regular pages because it breaks the Same |
29 // Origin Policy. | 30 // Origin Policy. |
30 switches::kEnableBrowserPluginForAllViewTypes, | 31 switches::kEnableBrowserPluginForAllViewTypes, |
31 NULL | 32 NULL |
32 }; | 33 }; |
33 | 34 |
34 const char* bad_flag = NULL; | 35 const char* bad_flag = NULL; |
35 for (const char** flag = kBadFlags; *flag; ++flag) { | 36 for (const char** flag = kBadFlags; *flag; ++flag) { |
36 if (CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { | 37 if (CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { |
37 bad_flag = *flag; | 38 bad_flag = *flag; |
(...skipping 11 matching lines...) Expand all Loading... |
49 new SimpleAlertInfoBarDelegate( | 50 new SimpleAlertInfoBarDelegate( |
50 infobar_tab_helper, NULL, | 51 infobar_tab_helper, NULL, |
51 l10n_util::GetStringFUTF16( | 52 l10n_util::GetStringFUTF16( |
52 IDS_BAD_FLAGS_WARNING_MESSAGE, | 53 IDS_BAD_FLAGS_WARNING_MESSAGE, |
53 UTF8ToUTF16(std::string("--") + bad_flag)), | 54 UTF8ToUTF16(std::string("--") + bad_flag)), |
54 false)); | 55 false)); |
55 } | 56 } |
56 } | 57 } |
57 | 58 |
58 } // namespace chrome | 59 } // namespace chrome |
OLD | NEW |