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 <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "content/public/common/security_style.h" | 106 #include "content/public/common/security_style.h" |
107 #include "content/public/common/url_constants.h" | 107 #include "content/public/common/url_constants.h" |
108 #include "content/public/common/url_utils.h" | 108 #include "content/public/common/url_utils.h" |
109 #include "content/public/common/web_preferences.h" | 109 #include "content/public/common/web_preferences.h" |
110 #include "mojo/common/url_type_converters.h" | 110 #include "mojo/common/url_type_converters.h" |
111 #include "mojo/converters/geometry/geometry_type_converters.h" | 111 #include "mojo/converters/geometry/geometry_type_converters.h" |
112 #include "net/http/http_cache.h" | 112 #include "net/http/http_cache.h" |
113 #include "net/http/http_transaction_factory.h" | 113 #include "net/http/http_transaction_factory.h" |
114 #include "net/url_request/url_request_context.h" | 114 #include "net/url_request/url_request_context.h" |
115 #include "net/url_request/url_request_context_getter.h" | 115 #include "net/url_request/url_request_context_getter.h" |
116 #include "skia/public/type_converters.h" | |
117 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 116 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
118 #include "third_party/skia/include/core/SkBitmap.h" | 117 #include "third_party/skia/include/core/SkBitmap.h" |
119 #include "ui/base/layout.h" | 118 #include "ui/base/layout.h" |
120 #include "ui/gfx/display.h" | 119 #include "ui/gfx/display.h" |
121 #include "ui/gfx/screen.h" | 120 #include "ui/gfx/screen.h" |
122 #include "ui/gl/gl_switches.h" | 121 #include "ui/gl/gl_switches.h" |
123 | 122 |
124 #if defined(OS_ANDROID) | 123 #if defined(OS_ANDROID) |
125 #include "content/browser/android/content_video_view.h" | 124 #include "content/browser/android/content_video_view.h" |
126 #include "content/browser/android/date_time_chooser_android.h" | 125 #include "content/browser/android/date_time_chooser_android.h" |
(...skipping 24 matching lines...) Expand all Loading... |
151 | 150 |
152 base::LazyInstance<std::vector<WebContentsImpl::CreatedCallback> > | 151 base::LazyInstance<std::vector<WebContentsImpl::CreatedCallback> > |
153 g_created_callbacks = LAZY_INSTANCE_INITIALIZER; | 152 g_created_callbacks = LAZY_INSTANCE_INITIALIZER; |
154 | 153 |
155 static void DidDownloadImage(const WebContents::ImageDownloadCallback& callback, | 154 static void DidDownloadImage(const WebContents::ImageDownloadCallback& callback, |
156 int id, | 155 int id, |
157 const GURL& image_url, | 156 const GURL& image_url, |
158 image_downloader::DownloadResultPtr result) { | 157 image_downloader::DownloadResultPtr result) { |
159 DCHECK(result); | 158 DCHECK(result); |
160 | 159 |
161 const std::vector<SkBitmap> images = | 160 std::vector<SkBitmap> images; |
162 result->images.To<std::vector<SkBitmap>>(); | 161 result->images.Swap(&images); |
163 const std::vector<gfx::Size> original_image_sizes = | 162 const std::vector<gfx::Size> original_image_sizes = |
164 result->original_image_sizes.To<std::vector<gfx::Size>>(); | 163 result->original_image_sizes.To<std::vector<gfx::Size>>(); |
165 | 164 |
166 callback.Run(id, result->http_status_code, image_url, images, | 165 callback.Run(id, result->http_status_code, image_url, images, |
167 original_image_sizes); | 166 original_image_sizes); |
168 } | 167 } |
169 | 168 |
170 void NotifyCacheOnIO( | 169 void NotifyCacheOnIO( |
171 scoped_refptr<net::URLRequestContextGetter> request_context, | 170 scoped_refptr<net::URLRequestContextGetter> request_context, |
172 const GURL& url, | 171 const GURL& url, |
(...skipping 4578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4751 const WebContentsObserver::MediaPlayerId& id) { | 4750 const WebContentsObserver::MediaPlayerId& id) { |
4752 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4751 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
4753 } | 4752 } |
4754 | 4753 |
4755 void WebContentsImpl::MediaStoppedPlaying( | 4754 void WebContentsImpl::MediaStoppedPlaying( |
4756 const WebContentsObserver::MediaPlayerId& id) { | 4755 const WebContentsObserver::MediaPlayerId& id) { |
4757 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4756 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
4758 } | 4757 } |
4759 | 4758 |
4760 } // namespace content | 4759 } // namespace content |
OLD | NEW |