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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" | 156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" | 157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h" |
158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData
.h" | 158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSearchableFormData
.h" |
159 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 159 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
160 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 160 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
161 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" | 161 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h" |
162 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" | 162 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" |
163 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h" | 163 #include "third_party/WebKit/Source/WebKit/chromium/public/WebUserMediaClient.h" |
164 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 164 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
165 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 165 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
| 166 #include "third_party/WebKit/Source/WebKit/chromium/public/default/WebRenderThem
e.h" |
166 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" | 167 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h
" |
167 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" | 168 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebDragData.
h" |
168 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" | 169 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebGraphicsC
ontext3D.h" |
169 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.
h" | 170 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebHTTPBody.
h" |
170 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" | 171 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebImage.h" |
171 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 172 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
172 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 173 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
173 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" | 174 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSerialize
dScriptValue.h" |
174 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 175 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
175 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" | 176 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSocketStr
eamHandle.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 #include "webkit/media/android/media_player_bridge_manager_impl.h" | 224 #include "webkit/media/android/media_player_bridge_manager_impl.h" |
224 #include "webkit/media/android/webmediaplayer_android.h" | 225 #include "webkit/media/android/webmediaplayer_android.h" |
225 #include "webkit/media/android/webmediaplayer_impl_android.h" | 226 #include "webkit/media/android/webmediaplayer_impl_android.h" |
226 #include "webkit/media/android/webmediaplayer_in_process_android.h" | 227 #include "webkit/media/android/webmediaplayer_in_process_android.h" |
227 #include "webkit/media/android/webmediaplayer_manager_android.h" | 228 #include "webkit/media/android/webmediaplayer_manager_android.h" |
228 #elif defined(OS_WIN) | 229 #elif defined(OS_WIN) |
229 // TODO(port): these files are currently Windows only because they concern: | 230 // TODO(port): these files are currently Windows only because they concern: |
230 // * theming | 231 // * theming |
231 #include "ui/native_theme/native_theme_win.h" | 232 #include "ui/native_theme/native_theme_win.h" |
232 #elif defined(USE_X11) | 233 #elif defined(USE_X11) |
233 #include "third_party/WebKit/Source/WebKit/chromium/public/default/WebRenderThem
e.h" | |
234 #include "ui/native_theme/native_theme.h" | 234 #include "ui/native_theme/native_theme.h" |
235 #elif defined(OS_MACOSX) | 235 #elif defined(OS_MACOSX) |
236 #include "skia/ext/skia_utils_mac.h" | 236 #include "skia/ext/skia_utils_mac.h" |
237 #endif | 237 #endif |
238 | 238 |
239 using WebKit::WebAccessibilityNotification; | 239 using WebKit::WebAccessibilityNotification; |
240 using WebKit::WebAccessibilityObject; | 240 using WebKit::WebAccessibilityObject; |
241 using WebKit::WebApplicationCacheHost; | 241 using WebKit::WebApplicationCacheHost; |
242 using WebKit::WebApplicationCacheHostClient; | 242 using WebKit::WebApplicationCacheHostClient; |
243 using WebKit::WebCString; | 243 using WebKit::WebCString; |
(...skipping 5059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5303 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( | 5303 void RenderViewImpl::OnDisableScrollbarsForSmallWindows( |
5304 const gfx::Size& disable_scrollbar_size_limit) { | 5304 const gfx::Size& disable_scrollbar_size_limit) { |
5305 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; | 5305 disable_scrollbars_size_limit_ = disable_scrollbar_size_limit; |
5306 } | 5306 } |
5307 | 5307 |
5308 void RenderViewImpl::OnSetRendererPrefs( | 5308 void RenderViewImpl::OnSetRendererPrefs( |
5309 const RendererPreferences& renderer_prefs) { | 5309 const RendererPreferences& renderer_prefs) { |
5310 double old_zoom_level = renderer_preferences_.default_zoom_level; | 5310 double old_zoom_level = renderer_preferences_.default_zoom_level; |
5311 renderer_preferences_ = renderer_prefs; | 5311 renderer_preferences_ = renderer_prefs; |
5312 UpdateFontRenderingFromRendererPrefs(); | 5312 UpdateFontRenderingFromRendererPrefs(); |
5313 #if defined(TOOLKIT_GTK) | 5313 |
| 5314 #if defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK) |
5314 WebColorName name = WebKit::WebColorWebkitFocusRingColor; | 5315 WebColorName name = WebKit::WebColorWebkitFocusRingColor; |
5315 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); | 5316 WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1); |
5316 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); | 5317 WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval); |
| 5318 #if defined(TOOLKIT_GTK) |
5317 ui::NativeTheme::instance()->SetScrollbarColors( | 5319 ui::NativeTheme::instance()->SetScrollbarColors( |
5318 renderer_prefs.thumb_inactive_color, | 5320 renderer_prefs.thumb_inactive_color, |
5319 renderer_prefs.thumb_active_color, | 5321 renderer_prefs.thumb_active_color, |
5320 renderer_prefs.track_color); | 5322 renderer_prefs.track_color); |
5321 #endif | 5323 #endif // defined(TOOLKIT_GTK) |
5322 | 5324 |
5323 #if defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK) | |
5324 if (webview()) { | 5325 if (webview()) { |
5325 #if defined(TOOLKIT_GTK) | 5326 #if defined(TOOLKIT_GTK) |
5326 webview()->setScrollbarColors( | 5327 webview()->setScrollbarColors( |
5327 renderer_prefs.thumb_inactive_color, | 5328 renderer_prefs.thumb_inactive_color, |
5328 renderer_prefs.thumb_active_color, | 5329 renderer_prefs.thumb_active_color, |
5329 renderer_prefs.track_color); | 5330 renderer_prefs.track_color); |
5330 #endif | 5331 #endif // defined(TOOLKIT_GTK) |
5331 webview()->setSelectionColors( | 5332 webview()->setSelectionColors( |
5332 renderer_prefs.active_selection_bg_color, | 5333 renderer_prefs.active_selection_bg_color, |
5333 renderer_prefs.active_selection_fg_color, | 5334 renderer_prefs.active_selection_fg_color, |
5334 renderer_prefs.inactive_selection_bg_color, | 5335 renderer_prefs.inactive_selection_bg_color, |
5335 renderer_prefs.inactive_selection_fg_color); | 5336 renderer_prefs.inactive_selection_fg_color); |
5336 webview()->themeChanged(); | 5337 webview()->themeChanged(); |
5337 } | 5338 } |
5338 #endif | 5339 #endif // defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK) |
5339 | 5340 |
5340 // If the zoom level for this page matches the old zoom default, and this | 5341 // If the zoom level for this page matches the old zoom default, and this |
5341 // is not a plugin, update the zoom level to match the new default. | 5342 // is not a plugin, update the zoom level to match the new default. |
5342 if (webview() && !webview()->mainFrame()->document().isPluginDocument() && | 5343 if (webview() && !webview()->mainFrame()->document().isPluginDocument() && |
5343 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) { | 5344 ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) { |
5344 webview()->setZoomLevel(false, renderer_preferences_.default_zoom_level); | 5345 webview()->setZoomLevel(false, renderer_preferences_.default_zoom_level); |
5345 zoomLevelChanged(); | 5346 zoomLevelChanged(); |
5346 } | 5347 } |
5347 } | 5348 } |
5348 | 5349 |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6506 } | 6507 } |
6507 #endif | 6508 #endif |
6508 | 6509 |
6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6510 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6510 TransportDIB::Handle dib_handle) { | 6511 TransportDIB::Handle dib_handle) { |
6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6512 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6512 RenderProcess::current()->ReleaseTransportDIB(dib); | 6513 RenderProcess::current()->ReleaseTransportDIB(dib); |
6513 } | 6514 } |
6514 | 6515 |
6515 } // namespace content | 6516 } // namespace content |
OLD | NEW |