| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 #endif | 1382 #endif |
| 1383 | 1383 |
| 1384 if (!view_) { | 1384 if (!view_) { |
| 1385 view_.reset(CreateWebContentsView(this, delegate, | 1385 view_.reset(CreateWebContentsView(this, delegate, |
| 1386 &render_view_host_delegate_view_)); | 1386 &render_view_host_delegate_view_)); |
| 1387 } | 1387 } |
| 1388 | 1388 |
| 1389 if (browser_plugin_guest_ && | 1389 if (browser_plugin_guest_ && |
| 1390 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { | 1390 !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
| 1391 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), | 1391 view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), |
| 1392 view_.Pass(), | 1392 std::move(view_), |
| 1393 &render_view_host_delegate_view_)); | 1393 &render_view_host_delegate_view_)); |
| 1394 } | 1394 } |
| 1395 CHECK(render_view_host_delegate_view_); | 1395 CHECK(render_view_host_delegate_view_); |
| 1396 CHECK(view_.get()); | 1396 CHECK(view_.get()); |
| 1397 | 1397 |
| 1398 gfx::Size initial_size = params.initial_size; | 1398 gfx::Size initial_size = params.initial_size; |
| 1399 view_->CreateView(initial_size, params.context); | 1399 view_->CreateView(initial_size, params.context); |
| 1400 | 1400 |
| 1401 #if defined(ENABLE_PLUGINS) | 1401 #if defined(ENABLE_PLUGINS) |
| 1402 plugin_content_origin_whitelist_.reset( | 1402 plugin_content_origin_whitelist_.reset( |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2585 } else { | 2585 } else { |
| 2586 for (const base::StringPiece& key_value : | 2586 for (const base::StringPiece& key_value : |
| 2587 base::SplitStringPiece( | 2587 base::SplitStringPiece( |
| 2588 headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { | 2588 headers, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
| 2589 std::vector<std::string> pair = base::SplitString( | 2589 std::vector<std::string> pair = base::SplitString( |
| 2590 key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 2590 key_value, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 2591 DCHECK_EQ(2ul, pair.size()); | 2591 DCHECK_EQ(2ul, pair.size()); |
| 2592 params->add_request_header(pair[0], pair[1]); | 2592 params->add_request_header(pair[0], pair[1]); |
| 2593 } | 2593 } |
| 2594 } | 2594 } |
| 2595 dlm->DownloadUrl(params.Pass()); | 2595 dlm->DownloadUrl(std::move(params)); |
| 2596 } | 2596 } |
| 2597 | 2597 |
| 2598 void WebContentsImpl::GenerateMHTML( | 2598 void WebContentsImpl::GenerateMHTML( |
| 2599 const base::FilePath& file, | 2599 const base::FilePath& file, |
| 2600 const base::Callback<void(int64_t)>& callback) { | 2600 const base::Callback<void(int64_t)>& callback) { |
| 2601 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); | 2601 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); |
| 2602 } | 2602 } |
| 2603 | 2603 |
| 2604 const std::string& WebContentsImpl::GetContentsMimeType() const { | 2604 const std::string& WebContentsImpl::GetContentsMimeType() const { |
| 2605 return contents_mime_type_; | 2605 return contents_mime_type_; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 | 2801 |
| 2802 image_downloader::DownloadRequestPtr req = | 2802 image_downloader::DownloadRequestPtr req = |
| 2803 image_downloader::DownloadRequest::New(); | 2803 image_downloader::DownloadRequest::New(); |
| 2804 | 2804 |
| 2805 req->url = mojo::String::From(url); | 2805 req->url = mojo::String::From(url); |
| 2806 req->is_favicon = is_favicon; | 2806 req->is_favicon = is_favicon; |
| 2807 req->max_bitmap_size = max_bitmap_size; | 2807 req->max_bitmap_size = max_bitmap_size; |
| 2808 req->bypass_cache = bypass_cache; | 2808 req->bypass_cache = bypass_cache; |
| 2809 | 2809 |
| 2810 mojo_image_downloader->DownloadImage( | 2810 mojo_image_downloader->DownloadImage( |
| 2811 req.Pass(), | 2811 std::move(req), |
| 2812 base::Bind(&DidDownloadImage, callback, download_id, url)); | 2812 base::Bind(&DidDownloadImage, callback, download_id, url)); |
| 2813 return download_id; | 2813 return download_id; |
| 2814 } | 2814 } |
| 2815 | 2815 |
| 2816 bool WebContentsImpl::IsSubframe() const { | 2816 bool WebContentsImpl::IsSubframe() const { |
| 2817 return is_subframe_; | 2817 return is_subframe_; |
| 2818 } | 2818 } |
| 2819 | 2819 |
| 2820 void WebContentsImpl::Find(int request_id, | 2820 void WebContentsImpl::Find(int request_id, |
| 2821 const base::string16& search_text, | 2821 const base::string16& search_text, |
| (...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4720 const WebContentsObserver::MediaPlayerId& id) { | 4720 const WebContentsObserver::MediaPlayerId& id) { |
| 4721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4722 } | 4722 } |
| 4723 | 4723 |
| 4724 void WebContentsImpl::MediaStoppedPlaying( | 4724 void WebContentsImpl::MediaStoppedPlaying( |
| 4725 const WebContentsObserver::MediaPlayerId& id) { | 4725 const WebContentsObserver::MediaPlayerId& id) { |
| 4726 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4726 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4727 } | 4727 } |
| 4728 | 4728 |
| 4729 } // namespace content | 4729 } // namespace content |
| OLD | NEW |