| 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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2396 // a BrowserPlugin prior to this will be ignored. | 2396 // a BrowserPlugin prior to this will be ignored. |
| 2397 // For more info, see comment above classes BrowserPluginEmbedder and | 2397 // For more info, see comment above classes BrowserPluginEmbedder and |
| 2398 // BrowserPluginGuest. | 2398 // BrowserPluginGuest. |
| 2399 CHECK(!browser_plugin_embedder_.get()); | 2399 CHECK(!browser_plugin_embedder_.get()); |
| 2400 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); | 2400 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
| 2401 browser_plugin_embedder_->OnMessageReceived(message); | 2401 browser_plugin_embedder_->OnMessageReceived(message); |
| 2402 } | 2402 } |
| 2403 | 2403 |
| 2404 void WebContentsImpl::OnDidDownloadImage( | 2404 void WebContentsImpl::OnDidDownloadImage( |
| 2405 int id, | 2405 int id, |
| 2406 int http_status_code, |
| 2406 const GURL& image_url, | 2407 const GURL& image_url, |
| 2407 int requested_size, | 2408 int requested_size, |
| 2408 const std::vector<SkBitmap>& bitmaps) { | 2409 const std::vector<SkBitmap>& bitmaps) { |
| 2409 ImageDownloadMap::iterator iter = image_download_map_.find(id); | 2410 ImageDownloadMap::iterator iter = image_download_map_.find(id); |
| 2410 if (iter == image_download_map_.end()) { | 2411 if (iter == image_download_map_.end()) { |
| 2411 // Currently WebContents notifies us of ANY downloads so that it is | 2412 // Currently WebContents notifies us of ANY downloads so that it is |
| 2412 // possible to get here. | 2413 // possible to get here. |
| 2413 return; | 2414 return; |
| 2414 } | 2415 } |
| 2415 if (!iter->second.is_null()) { | 2416 if (!iter->second.is_null()) { |
| 2416 iter->second.Run(id, image_url, requested_size, bitmaps); | 2417 iter->second.Run(id, http_status_code, image_url, requested_size, bitmaps); |
| 2417 } | 2418 } |
| 2418 image_download_map_.erase(id); | 2419 image_download_map_.erase(id); |
| 2419 } | 2420 } |
| 2420 | 2421 |
| 2421 void WebContentsImpl::OnUpdateFaviconURL( | 2422 void WebContentsImpl::OnUpdateFaviconURL( |
| 2422 int32 page_id, | 2423 int32 page_id, |
| 2423 const std::vector<FaviconURL>& candidates) { | 2424 const std::vector<FaviconURL>& candidates) { |
| 2424 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2425 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| 2425 DidUpdateFaviconURL(page_id, candidates)); | 2426 DidUpdateFaviconURL(page_id, candidates)); |
| 2426 } | 2427 } |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3457 } | 3458 } |
| 3458 | 3459 |
| 3459 BrowserPluginGuestManager* | 3460 BrowserPluginGuestManager* |
| 3460 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3461 WebContentsImpl::GetBrowserPluginGuestManager() const { |
| 3461 return static_cast<BrowserPluginGuestManager*>( | 3462 return static_cast<BrowserPluginGuestManager*>( |
| 3462 GetBrowserContext()->GetUserData( | 3463 GetBrowserContext()->GetUserData( |
| 3463 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3464 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
| 3464 } | 3465 } |
| 3465 | 3466 |
| 3466 } // namespace content | 3467 } // namespace content |
| OLD | NEW |