OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_frame/utils.h" | 5 #include "chrome_frame/utils.h" |
6 | 6 |
7 #include <atlsafe.h> | 7 #include <atlsafe.h> |
8 #include <atlsecurity.h> | 8 #include <atlsecurity.h> |
9 #include <htiframe.h> | 9 #include <htiframe.h> |
10 #include <mshtml.h> | 10 #include <mshtml.h> |
11 #include <shlobj.h> | 11 #include <shlobj.h> |
12 | 12 |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/file_version_info.h" | 14 #include "base/file_version_info.h" |
15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
19 #include "base/string_piece.h" | |
20 #include "base/string_tokenizer.h" | 19 #include "base/string_tokenizer.h" |
21 #include "base/string_util.h" | 20 #include "base/string_util.h" |
22 #include "base/stringprintf.h" | 21 #include "base/stringprintf.h" |
23 #include "base/threading/thread_local.h" | 22 #include "base/threading/thread_local.h" |
24 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
25 #include "base/win/registry.h" | 24 #include "base/win/registry.h" |
26 #include "base/win/scoped_bstr.h" | 25 #include "base/win/scoped_bstr.h" |
27 #include "base/win/scoped_comptr.h" | 26 #include "base/win/scoped_comptr.h" |
28 #include "base/win/scoped_variant.h" | 27 #include "base/win/scoped_variant.h" |
29 #include "chrome/common/automation_messages.h" | 28 #include "chrome/common/automation_messages.h" |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 return std::numeric_limits<int>::max(); | 1547 return std::numeric_limits<int>::max(); |
1549 } | 1548 } |
1550 | 1549 |
1551 if (filter_length < 3 || | 1550 if (filter_length < 3 || |
1552 !LowerCaseEqualsASCII(filter_begin, filter_begin + 2, "ie") || | 1551 !LowerCaseEqualsASCII(filter_begin, filter_begin + 2, "ie") || |
1553 !isdigit(*(filter_begin + 2))) { // ensure no leading +/- | 1552 !isdigit(*(filter_begin + 2))) { // ensure no leading +/- |
1554 continue; | 1553 continue; |
1555 } | 1554 } |
1556 | 1555 |
1557 int header_ie_version = 0; | 1556 int header_ie_version = 0; |
1558 if (!base::StringToInt(base::StringPiece(filter_begin + 2, | 1557 if (!base::StringToInt(filter_begin + 2, filter_end, &header_ie_version) || |
1559 filter_end), | |
1560 &header_ie_version) || | |
1561 header_ie_version == 0) { // ensure it's not a sequence of 0's | 1558 header_ie_version == 0) { // ensure it's not a sequence of 0's |
1562 continue; | 1559 continue; |
1563 } | 1560 } |
1564 | 1561 |
1565 // The first valid directive we find wins, whether it matches or not | 1562 // The first valid directive we find wins, whether it matches or not |
1566 return header_ie_version; | 1563 return header_ie_version; |
1567 } | 1564 } |
1568 return -1; | 1565 return -1; |
1569 } | 1566 } |
1570 | 1567 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1637 ret = InternetSetOption(NULL, connection_options[option_index], | 1634 ret = InternetSetOption(NULL, connection_options[option_index], |
1638 &connections, connection_value_size); | 1635 &connections, connection_value_size); |
1639 if (!ret) { | 1636 if (!ret) { |
1640 return false; | 1637 return false; |
1641 } | 1638 } |
1642 } | 1639 } |
1643 wininet_connection_count_updated = true; | 1640 wininet_connection_count_updated = true; |
1644 return true; | 1641 return true; |
1645 } | 1642 } |
1646 | 1643 |
OLD | NEW |