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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 // a BrowserPlugin prior to this will be ignored. | 2390 // a BrowserPlugin prior to this will be ignored. |
2391 // For more info, see comment above classes BrowserPluginEmbedder and | 2391 // For more info, see comment above classes BrowserPluginEmbedder and |
2392 // BrowserPluginGuest. | 2392 // BrowserPluginGuest. |
2393 CHECK(!browser_plugin_embedder_.get()); | 2393 CHECK(!browser_plugin_embedder_.get()); |
2394 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); | 2394 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
2395 browser_plugin_embedder_->OnMessageReceived(message); | 2395 browser_plugin_embedder_->OnMessageReceived(message); |
2396 } | 2396 } |
2397 | 2397 |
2398 void WebContentsImpl::OnDidDownloadImage( | 2398 void WebContentsImpl::OnDidDownloadImage( |
2399 int id, | 2399 int id, |
| 2400 int http_status_code, |
2400 const GURL& image_url, | 2401 const GURL& image_url, |
2401 int requested_size, | 2402 int requested_size, |
2402 const std::vector<SkBitmap>& bitmaps) { | 2403 const std::vector<SkBitmap>& bitmaps) { |
2403 ImageDownloadMap::iterator iter = image_download_map_.find(id); | 2404 ImageDownloadMap::iterator iter = image_download_map_.find(id); |
2404 if (iter == image_download_map_.end()) { | 2405 if (iter == image_download_map_.end()) { |
2405 // Currently WebContents notifies us of ANY downloads so that it is | 2406 // Currently WebContents notifies us of ANY downloads so that it is |
2406 // possible to get here. | 2407 // possible to get here. |
2407 return; | 2408 return; |
2408 } | 2409 } |
2409 if (!iter->second.is_null()) { | 2410 if (!iter->second.is_null()) { |
2410 iter->second.Run(id, image_url, requested_size, bitmaps); | 2411 iter->second.Run(id, http_status_code, image_url, requested_size, bitmaps); |
2411 } | 2412 } |
2412 image_download_map_.erase(id); | 2413 image_download_map_.erase(id); |
2413 } | 2414 } |
2414 | 2415 |
2415 void WebContentsImpl::OnUpdateFaviconURL( | 2416 void WebContentsImpl::OnUpdateFaviconURL( |
2416 int32 page_id, | 2417 int32 page_id, |
2417 const std::vector<FaviconURL>& candidates) { | 2418 const std::vector<FaviconURL>& candidates) { |
2418 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2419 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2419 DidUpdateFaviconURL(page_id, candidates)); | 2420 DidUpdateFaviconURL(page_id, candidates)); |
2420 } | 2421 } |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3517 } | 3518 } |
3518 | 3519 |
3519 BrowserPluginGuestManager* | 3520 BrowserPluginGuestManager* |
3520 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3521 WebContentsImpl::GetBrowserPluginGuestManager() const { |
3521 return static_cast<BrowserPluginGuestManager*>( | 3522 return static_cast<BrowserPluginGuestManager*>( |
3522 GetBrowserContext()->GetUserData( | 3523 GetBrowserContext()->GetUserData( |
3523 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3524 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
3524 } | 3525 } |
3525 | 3526 |
3526 } // namespace content | 3527 } // namespace content |
OLD | NEW |