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

Side by Side Diff: webkit/activex_shim/activex_shared.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | webkit/glue/plugins/plugin_list_win.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/activex_shim/activex_shared.h" 5 #include "webkit/activex_shim/activex_shared.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return true; 81 return true;
82 } 82 }
83 return false; 83 return false;
84 } 84 }
85 85
86 // Whether allow-all-activex is specified in the command line. 86 // Whether allow-all-activex is specified in the command line.
87 static bool IsAllowAllActiveX() { 87 static bool IsAllowAllActiveX() {
88 static bool parsed_flag = false; 88 static bool parsed_flag = false;
89 static bool allow_all_activex = false; 89 static bool allow_all_activex = false;
90 if (!parsed_flag) { 90 if (!parsed_flag) {
91 CommandLine command_line; 91 allow_all_activex =
92 allow_all_activex = command_line.HasSwitch(kAllowAllActiveX); 92 CommandLine::ForCurrentProcess()->HasSwitch(kAllowAllActiveX);
93 parsed_flag = true; 93 parsed_flag = true;
94 } 94 }
95 return allow_all_activex; 95 return allow_all_activex;
96 } 96 }
97 97
98 // If an ActiveX control is allowed to run from a specific URL. 98 // If an ActiveX control is allowed to run from a specific URL.
99 bool IsActiveXAllowed(const std::string& clsid, const GURL& url) { 99 bool IsActiveXAllowed(const std::string& clsid, const GURL& url) {
100 if (IsAllowAllActiveX()) 100 if (IsAllowAllActiveX())
101 return true; 101 return true;
102 const ActiveXAttribute* attr = FindActiveX(clsid); 102 const ActiveXAttribute* attr = FindActiveX(clsid);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 return file_version_ls >= requested_version_ls; 220 return file_version_ls >= requested_version_ls;
221 } 221 }
222 222
223 bool IsMimeTypeActiveX(const std::string& mimetype) { 223 bool IsMimeTypeActiveX(const std::string& mimetype) {
224 return LowerCaseEqualsASCII(mimetype, "application/x-oleobject") || 224 return LowerCaseEqualsASCII(mimetype, "application/x-oleobject") ||
225 LowerCaseEqualsASCII(mimetype, "application/oleobject"); 225 LowerCaseEqualsASCII(mimetype, "application/oleobject");
226 } 226 }
227 227
228 } // namespace activex_shim 228 } // namespace activex_shim
229 229
OLDNEW
« no previous file with comments | « skia/ext/vector_canvas_unittest.cc ('k') | webkit/glue/plugins/plugin_list_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698