Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: chrome/browser/ui/startup/bad_flags_prompt.cc

Issue 12792005: Allow extensions on chrome:// URLs, when flag is set and permission is explicitly requested (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstate original pickle order; add scripts clause to content_script_chrome_url_invalid.json to av… Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/user_script_master.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/infobars/infobar_service.h" 9 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h" 10 #include "chrome/browser/infobars/simple_alert_infobar_delegate.h"
(...skipping 10 matching lines...) Expand all
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 // Browser plugin is dangerous on regular pages because it breaks the Same 28 // Browser plugin is dangerous on regular pages because it breaks the Same
29 // Origin Policy. 29 // Origin Policy.
30 switches::kEnableBrowserPluginForAllViewTypes, 30 switches::kEnableBrowserPluginForAllViewTypes,
31 switches::kExtensionsOnChromeURLs,
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;
38 break; 39 break;
39 } 40 }
40 } 41 }
41 42
42 if (bad_flag) { 43 if (bad_flag) {
43 content::WebContents* web_contents = 44 content::WebContents* web_contents =
44 browser->tab_strip_model()->GetActiveWebContents(); 45 browser->tab_strip_model()->GetActiveWebContents();
45 if (!web_contents) 46 if (!web_contents)
46 return; 47 return;
47 SimpleAlertInfoBarDelegate::Create( 48 SimpleAlertInfoBarDelegate::Create(
48 InfoBarService::FromWebContents(web_contents), NULL, 49 InfoBarService::FromWebContents(web_contents), NULL,
49 l10n_util::GetStringFUTF16(IDS_BAD_FLAGS_WARNING_MESSAGE, 50 l10n_util::GetStringFUTF16(IDS_BAD_FLAGS_WARNING_MESSAGE,
50 UTF8ToUTF16(std::string("--") + bad_flag)), 51 UTF8ToUTF16(std::string("--") + bad_flag)),
51 false); 52 false);
52 } 53 }
53 } 54 }
54 55
55 } // namespace chrome 56 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/extensions/user_script_master.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698