| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } else if (version.dwMajorVersion > 5 || | 73 } else if (version.dwMajorVersion > 5 || |
| 74 (version.dwMajorVersion == 5 && version.dwMinorVersion >= 2)) { | 74 (version.dwMajorVersion == 5 && version.dwMinorVersion >= 2)) { |
| 75 // 6.0 is Vista or Server 2008; it's now worth a try. | 75 // 6.0 is Vista or Server 2008; it's now worth a try. |
| 76 } else { | 76 } else { |
| 77 std::string error = std::string("Unsupported Windows version."); | 77 std::string error = std::string("Unsupported Windows version."); |
| 78 if (!AskUser(npp, error)) return false; | 78 if (!AskUser(npp, error)) return false; |
| 79 } | 79 } |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Checks user agent string. We only allow Firefox, Chrome, and IE. | 83 // Checks user agent string. We only allow Firefox, Chrome, Safari and IE. |
| 84 bool CheckUserAgent(NPP npp, const std::string &user_agent) { | 84 bool CheckUserAgent(NPP npp, const std::string &user_agent) { |
| 85 if (user_agent.find("Firefox") == user_agent.npos && | 85 if (user_agent.find("Firefox") == user_agent.npos && |
| 86 user_agent.find("Chrome") == user_agent.npos && | 86 user_agent.find("Chrome") == user_agent.npos && |
| 87 user_agent.find("MSIE") == user_agent.npos) { | 87 user_agent.find("MSIE") == user_agent.npos && |
| 88 user_agent.find("Safari") == user_agent.npos) { |
| 88 std::string error = std::string("Unsupported user agent: ") + user_agent; | 89 std::string error = std::string("Unsupported user agent: ") + user_agent; |
| 89 return AskUser(npp, error); | 90 return AskUser(npp, error); |
| 90 } | 91 } |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| 93 | 94 |
| 94 bool OpenDriverBlacklistFile(std::ifstream *input_file) { | 95 bool OpenDriverBlacklistFile(std::ifstream *input_file) { |
| 95 CHECK(input_file); | 96 CHECK(input_file); |
| 96 CHECK(!input_file->is_open()); | 97 CHECK(!input_file->is_open()); |
| 97 | 98 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } else if (std::string::npos != user_agent.find("Firefox")) { | 229 } else if (std::string::npos != user_agent.find("Firefox")) { |
| 229 o3d::metric_browser_type = o3d::BROWSER_NAME_FIREFOX; | 230 o3d::metric_browser_type = o3d::BROWSER_NAME_FIREFOX; |
| 230 } else if (std::string::npos != user_agent.find("MSIE")) { | 231 } else if (std::string::npos != user_agent.find("MSIE")) { |
| 231 o3d::metric_browser_type = o3d::BROWSER_NAME_MSIE; | 232 o3d::metric_browser_type = o3d::BROWSER_NAME_MSIE; |
| 232 } else { | 233 } else { |
| 233 o3d::metric_browser_type = o3d::BROWSER_NAME_UNKNOWN; | 234 o3d::metric_browser_type = o3d::BROWSER_NAME_UNKNOWN; |
| 234 } | 235 } |
| 235 return true; | 236 return true; |
| 236 } | 237 } |
| 237 } // namespace o3d | 238 } // namespace o3d |
| OLD | NEW |