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/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) | 1091 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) |
1092 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, | 1092 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, |
1093 OnEnumerateDirectoryResponse) | 1093 OnEnumerateDirectoryResponse) |
1094 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) | 1094 IPC_MESSAGE_HANDLER(ViewMsg_RunFileChooserResponse, OnFileChooserResponse) |
1095 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut, | 1095 IPC_MESSAGE_HANDLER(ViewMsg_SuppressDialogsUntilSwapOut, |
1096 OnSuppressDialogsUntilSwapOut) | 1096 OnSuppressDialogsUntilSwapOut) |
1097 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) | 1097 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) |
1098 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) | 1098 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) |
1099 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) | 1099 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
1100 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) | 1100 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) |
1101 IPC_MESSAGE_HANDLER(ViewMsg_SetBackground, OnSetBackground) | 1101 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) |
1102 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, | 1102 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, |
1103 OnEnablePreferredSizeChangedMode) | 1103 OnEnablePreferredSizeChangedMode) |
1104 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) | 1104 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) |
1105 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) | 1105 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) |
1106 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, | 1106 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, |
1107 OnDisableScrollbarsForSmallWindows) | 1107 OnDisableScrollbarsForSmallWindows) |
1108 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 1108 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
1109 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) | 1109 IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) |
1110 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) | 1110 IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) |
1111 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) | 1111 IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) |
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3182 gfx::Vector2d RenderViewImpl::GetScrollOffset() { | 3182 gfx::Vector2d RenderViewImpl::GetScrollOffset() { |
3183 WebSize scroll_offset = webview()->mainFrame()->scrollOffset(); | 3183 WebSize scroll_offset = webview()->mainFrame()->scrollOffset(); |
3184 return gfx::Vector2d(scroll_offset.width, scroll_offset.height); | 3184 return gfx::Vector2d(scroll_offset.width, scroll_offset.height); |
3185 } | 3185 } |
3186 | 3186 |
3187 void RenderViewImpl::OnClearFocusedElement() { | 3187 void RenderViewImpl::OnClearFocusedElement() { |
3188 if (webview()) | 3188 if (webview()) |
3189 webview()->clearFocusedElement(); | 3189 webview()->clearFocusedElement(); |
3190 } | 3190 } |
3191 | 3191 |
3192 void RenderViewImpl::OnSetBackground(const SkBitmap& background) { | 3192 void RenderViewImpl::OnSetBackgroundOpaque(bool opaque) { |
3193 if (webview()) | 3193 if (webview()) |
3194 webview()->setIsTransparent(!background.empty()); | 3194 webview()->setIsTransparent(!opaque); |
3195 if (compositor_) | 3195 if (compositor_) |
3196 compositor_->setHasTransparentBackground(!background.empty()); | 3196 compositor_->setHasTransparentBackground(!opaque); |
3197 | |
3198 SetBackground(background); | |
3199 } | 3197 } |
3200 | 3198 |
3201 void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { | 3199 void RenderViewImpl::OnSetAccessibilityMode(AccessibilityMode new_mode) { |
3202 if (accessibility_mode_ == new_mode) | 3200 if (accessibility_mode_ == new_mode) |
3203 return; | 3201 return; |
3204 accessibility_mode_ = new_mode; | 3202 accessibility_mode_ = new_mode; |
3205 if (renderer_accessibility_) { | 3203 if (renderer_accessibility_) { |
3206 delete renderer_accessibility_; | 3204 delete renderer_accessibility_; |
3207 renderer_accessibility_ = NULL; | 3205 renderer_accessibility_ = NULL; |
3208 } | 3206 } |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4065 std::vector<gfx::Size> sizes; | 4063 std::vector<gfx::Size> sizes; |
4066 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4064 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4067 if (!url.isEmpty()) | 4065 if (!url.isEmpty()) |
4068 urls.push_back( | 4066 urls.push_back( |
4069 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4067 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4070 } | 4068 } |
4071 SendUpdateFaviconURL(urls); | 4069 SendUpdateFaviconURL(urls); |
4072 } | 4070 } |
4073 | 4071 |
4074 } // namespace content | 4072 } // namespace content |
OLD | NEW |