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 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 browser_plugin_embedder_.reset( | 2363 browser_plugin_embedder_.reset( |
2364 BrowserPluginEmbedder::Create(this, GetRenderViewHost())); | 2364 BrowserPluginEmbedder::Create(this, GetRenderViewHost())); |
2365 BrowserPluginHostMsg_CreateGuest create_guest_msg( | 2365 BrowserPluginHostMsg_CreateGuest create_guest_msg( |
2366 GetRenderViewHost()->GetRoutingID(), instance_id, params); | 2366 GetRenderViewHost()->GetRoutingID(), instance_id, params); |
2367 browser_plugin_embedder_->OnMessageReceived(create_guest_msg); | 2367 browser_plugin_embedder_->OnMessageReceived(create_guest_msg); |
2368 } | 2368 } |
2369 | 2369 |
2370 void WebContentsImpl::OnDidDownloadFavicon( | 2370 void WebContentsImpl::OnDidDownloadFavicon( |
2371 int id, | 2371 int id, |
2372 const GURL& image_url, | 2372 const GURL& image_url, |
2373 bool errored, | |
2374 int requested_size, | 2373 int requested_size, |
2375 const std::vector<SkBitmap>& bitmaps) { | 2374 const std::vector<SkBitmap>& bitmaps) { |
2376 FaviconDownloadMap::iterator iter = favicon_download_map_.find(id); | 2375 FaviconDownloadMap::iterator iter = favicon_download_map_.find(id); |
2377 if (iter == favicon_download_map_.end()) { | 2376 if (iter == favicon_download_map_.end()) { |
2378 // Currently WebContents notifies us of ANY downloads so that it is | 2377 // Currently WebContents notifies us of ANY downloads so that it is |
2379 // possible to get here. | 2378 // possible to get here. |
2380 return; | 2379 return; |
2381 } | 2380 } |
2382 if (!iter->second.is_null()) { | 2381 if (!iter->second.is_null()) { |
2383 iter->second.Run(id, image_url, errored, requested_size, bitmaps); | 2382 iter->second.Run(id, image_url, requested_size, bitmaps); |
2384 } | 2383 } |
2385 favicon_download_map_.erase(id); | 2384 favicon_download_map_.erase(id); |
2386 } | 2385 } |
2387 | 2386 |
2388 void WebContentsImpl::OnUpdateFaviconURL( | 2387 void WebContentsImpl::OnUpdateFaviconURL( |
2389 int32 page_id, | 2388 int32 page_id, |
2390 const std::vector<FaviconURL>& candidates) { | 2389 const std::vector<FaviconURL>& candidates) { |
2391 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2390 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2392 DidUpdateFaviconURL(page_id, candidates)); | 2391 DidUpdateFaviconURL(page_id, candidates)); |
2393 } | 2392 } |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3394 | 3393 |
3395 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { | 3394 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { |
3396 return browser_plugin_guest_.get(); | 3395 return browser_plugin_guest_.get(); |
3397 } | 3396 } |
3398 | 3397 |
3399 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { | 3398 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { |
3400 return browser_plugin_embedder_.get(); | 3399 return browser_plugin_embedder_.get(); |
3401 } | 3400 } |
3402 | 3401 |
3403 } // namespace content | 3402 } // namespace content |
OLD | NEW |