OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |