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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 2457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 DownloadUrlParameters::FromWebContents(this, url)); | 2468 DownloadUrlParameters::FromWebContents(this, url)); |
2469 params->set_referrer(referrer); | 2469 params->set_referrer(referrer); |
2470 params->set_post_id(post_id); | 2470 params->set_post_id(post_id); |
2471 if (post_id >= 0) | 2471 if (post_id >= 0) |
2472 params->set_method("POST"); | 2472 params->set_method("POST"); |
2473 params->set_prompt(true); | 2473 params->set_prompt(true); |
2474 | 2474 |
2475 if (headers.empty()) { | 2475 if (headers.empty()) { |
2476 params->set_prefer_cache(true); | 2476 params->set_prefer_cache(true); |
2477 } else { | 2477 } else { |
2478 std::vector<std::string> key_value_list; | 2478 for (const base::StringPiece& key_value : |
2479 base::SplitString(headers, '\n', &key_value_list); | 2479 base::SplitStringPiece( |
2480 for (const auto& key_value : key_value_list) { | 2480 headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
2481 std::vector<std::string> pair; | 2481 std::vector<std::string> pair = base::SplitString( |
2482 base::SplitString(key_value, ':', &pair); | 2482 key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
2483 DCHECK_EQ(2ul, pair.size()); | 2483 DCHECK_EQ(2ul, pair.size()); |
2484 params->add_request_header(pair[0], pair[1]); | 2484 params->add_request_header(pair[0], pair[1]); |
2485 } | 2485 } |
2486 } | 2486 } |
2487 dlm->DownloadUrl(params.Pass()); | 2487 dlm->DownloadUrl(params.Pass()); |
2488 } | 2488 } |
2489 | 2489 |
2490 void WebContentsImpl::GenerateMHTML( | 2490 void WebContentsImpl::GenerateMHTML( |
2491 const base::FilePath& file, | 2491 const base::FilePath& file, |
2492 const base::Callback<void(int64)>& callback) { | 2492 const base::Callback<void(int64)>& callback) { |
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 player_map->erase(it); | 4608 player_map->erase(it); |
4609 } | 4609 } |
4610 | 4610 |
4611 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4611 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4612 force_disable_overscroll_content_ = force_disable; | 4612 force_disable_overscroll_content_ = force_disable; |
4613 if (view_) | 4613 if (view_) |
4614 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4614 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4615 } | 4615 } |
4616 | 4616 |
4617 } // namespace content | 4617 } // namespace content |
OLD | NEW |