OLD | NEW |
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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 (*setter)(settings, it->second, GetScriptForWebSettings(code)); | 593 (*setter)(settings, it->second, GetScriptForWebSettings(code)); |
594 } | 594 } |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
598 void ApplyBlinkSettings(const base::CommandLine& command_line, | 598 void ApplyBlinkSettings(const base::CommandLine& command_line, |
599 WebSettings* settings) { | 599 WebSettings* settings) { |
600 if (!command_line.HasSwitch(switches::kBlinkSettings)) | 600 if (!command_line.HasSwitch(switches::kBlinkSettings)) |
601 return; | 601 return; |
602 | 602 |
603 std::vector<std::string> blink_settings; | 603 std::vector<std::string> blink_settings = base::SplitString( |
604 base::SplitString( | 604 command_line.GetSwitchValueASCII(switches::kBlinkSettings), |
605 command_line.GetSwitchValueASCII(switches::kBlinkSettings), ',', | 605 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
606 &blink_settings); | |
607 for (const std::string& setting : blink_settings) { | 606 for (const std::string& setting : blink_settings) { |
608 size_t pos = setting.find('='); | 607 size_t pos = setting.find('='); |
609 settings->setFromStrings( | 608 settings->setFromStrings( |
610 blink::WebString::fromLatin1(setting.substr(0, pos)), | 609 blink::WebString::fromLatin1(setting.substr(0, pos)), |
611 blink::WebString::fromLatin1( | 610 blink::WebString::fromLatin1( |
612 pos == std::string::npos ? "" : setting.substr(pos + 1))); | 611 pos == std::string::npos ? "" : setting.substr(pos + 1))); |
613 } | 612 } |
614 } | 613 } |
615 | 614 |
616 // Looks up and returns the WebFrame corresponding to a given opener frame | 615 // Looks up and returns the WebFrame corresponding to a given opener frame |
(...skipping 3207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 std::vector<gfx::Size> sizes; | 3823 std::vector<gfx::Size> sizes; |
3825 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 3824 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
3826 if (!url.isEmpty()) | 3825 if (!url.isEmpty()) |
3827 urls.push_back( | 3826 urls.push_back( |
3828 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 3827 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
3829 } | 3828 } |
3830 SendUpdateFaviconURL(urls); | 3829 SendUpdateFaviconURL(urls); |
3831 } | 3830 } |
3832 | 3831 |
3833 } // namespace content | 3832 } // namespace content |
OLD | NEW |