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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #if defined(OS_ANDROID) | 175 #if defined(OS_ANDROID) |
176 #include <cpu-features.h> | 176 #include <cpu-features.h> |
177 | 177 |
178 #include "content/renderer/android/address_detector.h" | 178 #include "content/renderer/android/address_detector.h" |
179 #include "content/renderer/android/content_detector.h" | 179 #include "content/renderer/android/content_detector.h" |
180 #include "content/renderer/android/disambiguation_popup_helper.h" | 180 #include "content/renderer/android/disambiguation_popup_helper.h" |
181 #include "content/renderer/android/email_detector.h" | 181 #include "content/renderer/android/email_detector.h" |
182 #include "content/renderer/android/phone_number_detector.h" | 182 #include "content/renderer/android/phone_number_detector.h" |
183 #include "ui/gfx/geometry/rect_f.h" | 183 #include "ui/gfx/geometry/rect_f.h" |
184 | 184 |
185 #elif defined(OS_WIN) | |
186 // TODO(port): these files are currently Windows only because they concern: | |
187 // * theming | |
188 #include "ui/native_theme/native_theme_win.h" | |
189 #elif defined(USE_X11) | |
190 #include "ui/native_theme/native_theme.h" | |
191 #elif defined(OS_MACOSX) | 185 #elif defined(OS_MACOSX) |
192 #include "skia/ext/skia_utils_mac.h" | 186 #include "skia/ext/skia_utils_mac.h" |
193 #endif | 187 #endif |
194 | 188 |
195 #if defined(ENABLE_PLUGINS) | 189 #if defined(ENABLE_PLUGINS) |
196 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 190 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
197 #include "content/renderer/pepper/pepper_plugin_registry.h" | 191 #include "content/renderer/pepper/pepper_plugin_registry.h" |
198 #endif | 192 #endif |
199 | 193 |
200 #if defined(ENABLE_WEBRTC) | 194 #if defined(ENABLE_WEBRTC) |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) | 1318 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) |
1325 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, | 1319 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, |
1326 OnDragSourceSystemDragEnded) | 1320 OnDragSourceSystemDragEnded) |
1327 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) | 1321 IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings) |
1328 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) | 1322 IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus) |
1329 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) | 1323 IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck) |
1330 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) | 1324 IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences) |
1331 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, | 1325 IPC_MESSAGE_HANDLER(ViewMsg_EnumerateDirectoryResponse, |
1332 OnEnumerateDirectoryResponse) | 1326 OnEnumerateDirectoryResponse) |
1333 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) | 1327 IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) |
1334 IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) | |
1335 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) | 1328 IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted) |
1336 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) | 1329 IPC_MESSAGE_HANDLER(ViewMsg_ClearFocusedElement, OnClearFocusedElement) |
1337 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) | 1330 IPC_MESSAGE_HANDLER(ViewMsg_SetBackgroundOpaque, OnSetBackgroundOpaque) |
1338 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, | 1331 IPC_MESSAGE_HANDLER(ViewMsg_EnablePreferredSizeChangedMode, |
1339 OnEnablePreferredSizeChangedMode) | 1332 OnEnablePreferredSizeChangedMode) |
1340 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) | 1333 IPC_MESSAGE_HANDLER(ViewMsg_EnableAutoResize, OnEnableAutoResize) |
1341 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) | 1334 IPC_MESSAGE_HANDLER(ViewMsg_DisableAutoResize, OnDisableAutoResize) |
1342 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, | 1335 IPC_MESSAGE_HANDLER(ViewMsg_DisableScrollbarsForSmallWindows, |
1343 OnDisableScrollbarsForSmallWindows) | 1336 OnDisableScrollbarsForSmallWindows) |
1344 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) | 1337 IPC_MESSAGE_HANDLER(ViewMsg_SetRendererPrefs, OnSetRendererPrefs) |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 | 2501 |
2509 Send(new ViewHostMsg_ClosePage_ACK(GetRoutingID())); | 2502 Send(new ViewHostMsg_ClosePage_ACK(GetRoutingID())); |
2510 } | 2503 } |
2511 | 2504 |
2512 void RenderViewImpl::OnClose() { | 2505 void RenderViewImpl::OnClose() { |
2513 if (closing_) | 2506 if (closing_) |
2514 RenderThread::Get()->Send(new ViewHostMsg_Close_ACK(GetRoutingID())); | 2507 RenderThread::Get()->Send(new ViewHostMsg_Close_ACK(GetRoutingID())); |
2515 RenderWidget::OnClose(); | 2508 RenderWidget::OnClose(); |
2516 } | 2509 } |
2517 | 2510 |
2518 void RenderViewImpl::OnThemeChanged() { | |
2519 #if defined(USE_AURA) | |
2520 // Aura doesn't care if we switch themes. | |
2521 #elif defined(OS_WIN) | |
2522 ui::NativeThemeWin::instance()->CloseHandles(); | |
2523 if (webview()) | |
2524 webview()->themeChanged(); | |
2525 #else // defined(OS_WIN) | |
2526 // TODO(port): we don't support theming on non-Windows platforms yet | |
2527 NOTIMPLEMENTED(); | |
2528 #endif | |
2529 } | |
2530 | |
2531 void RenderViewImpl::OnMoveOrResizeStarted() { | 2511 void RenderViewImpl::OnMoveOrResizeStarted() { |
2532 if (webview()) | 2512 if (webview()) |
2533 webview()->hidePopups(); | 2513 webview()->hidePopups(); |
2534 } | 2514 } |
2535 | 2515 |
2536 void RenderViewImpl::ResizeWebWidget() { | 2516 void RenderViewImpl::ResizeWebWidget() { |
2537 webview()->resizeWithTopControls(GetSizeForWebWidget(), | 2517 webview()->resizeWithTopControls(GetSizeForWebWidget(), |
2538 top_controls_height_, | 2518 top_controls_height_, |
2539 top_controls_shrink_blink_size_); | 2519 top_controls_shrink_blink_size_); |
2540 } | 2520 } |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 return render_frame->focused_pepper_plugin(); | 3060 return render_frame->focused_pepper_plugin(); |
3081 } | 3061 } |
3082 frame = frame->traverseNext(false); | 3062 frame = frame->traverseNext(false); |
3083 } | 3063 } |
3084 | 3064 |
3085 return nullptr; | 3065 return nullptr; |
3086 } | 3066 } |
3087 #endif | 3067 #endif |
3088 | 3068 |
3089 } // namespace content | 3069 } // namespace content |
OLD | NEW |