Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 175903002: Re-add snap-back behavior (Chrome side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 108 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
109 #include "third_party/WebKit/public/web/WebScriptController.h" 109 #include "third_party/WebKit/public/web/WebScriptController.h"
110 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" 110 #include "third_party/WebKit/public/web/WebSecurityPolicy.h"
111 #include "third_party/WebKit/public/web/WebView.h" 111 #include "third_party/WebKit/public/web/WebView.h"
112 #include "third_party/skia/include/core/SkGraphics.h" 112 #include "third_party/skia/include/core/SkGraphics.h"
113 #include "ui/base/layout.h" 113 #include "ui/base/layout.h"
114 #include "ui/base/ui_base_switches.h" 114 #include "ui/base/ui_base_switches.h"
115 #include "v8/include/v8.h" 115 #include "v8/include/v8.h"
116 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h" 116 #include "webkit/renderer/compositor_bindings/web_external_bitmap_impl.h"
117 117
118 #if defined(OS_ANDROID)
119 #include <cpu-features.h>
120 #include "content/renderer/android/synchronous_compositor_factory.h"
121 #include "content/renderer/media/android/renderer_demuxer_android.h"
122 #endif
123
124 #if defined(OS_MACOSX)
125 #include "content/renderer/webscrollbarbehavior_impl_mac.h"
126 #endif
127
128 #if defined(OS_POSIX)
129 #include "ipc/ipc_channel_posix.h"
130 #endif
131
118 #if defined(OS_WIN) 132 #if defined(OS_WIN)
119 #include <windows.h> 133 #include <windows.h>
120 #include <objbase.h> 134 #include <objbase.h>
121 #else 135 #else
122 // TODO(port) 136 // TODO(port)
123 #include "base/memory/scoped_handle.h" 137 #include "base/memory/scoped_handle.h"
124 #include "content/child/npapi/np_channel_base.h" 138 #include "content/child/npapi/np_channel_base.h"
125 #endif 139 #endif
126 140
127 #if defined(OS_POSIX)
128 #include "ipc/ipc_channel_posix.h"
129 #endif
130
131 #if defined(OS_ANDROID)
132 #include <cpu-features.h>
133 #include "content/renderer/android/synchronous_compositor_factory.h"
134 #include "content/renderer/media/android/renderer_demuxer_android.h"
135 #endif
136
137 #if defined(ENABLE_PLUGINS) 141 #if defined(ENABLE_PLUGINS)
138 #include "content/renderer/npapi/plugin_channel_host.h" 142 #include "content/renderer/npapi/plugin_channel_host.h"
139 #endif 143 #endif
140 144
141 using base::ThreadRestrictions; 145 using base::ThreadRestrictions;
142 using blink::WebDocument; 146 using blink::WebDocument;
143 using blink::WebFrame; 147 using blink::WebFrame;
144 using blink::WebNetworkStateNotifier; 148 using blink::WebNetworkStateNotifier;
145 using blink::WebRuntimeFeatures; 149 using blink::WebRuntimeFeatures;
146 using blink::WebScriptController; 150 using blink::WebScriptController;
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 } 1315 }
1312 #endif 1316 #endif
1313 1317
1314 #if defined(OS_MACOSX) 1318 #if defined(OS_MACOSX)
1315 void RenderThreadImpl::OnUpdateScrollbarTheme( 1319 void RenderThreadImpl::OnUpdateScrollbarTheme(
1316 float initial_button_delay, 1320 float initial_button_delay,
1317 float autoscroll_button_delay, 1321 float autoscroll_button_delay,
1318 bool jump_on_track_click, 1322 bool jump_on_track_click,
1319 blink::ScrollerStyle preferred_scroller_style, 1323 blink::ScrollerStyle preferred_scroller_style,
1320 bool redraw) { 1324 bool redraw) {
1325 static_cast<WebScrollbarBehaviorImpl*>(
1326 webkit_platform_support_->scrollbarBehavior())->set_jump_on_track_click(
1327 jump_on_track_click);
1321 blink::WebScrollbarTheme::updateScrollbars(initial_button_delay, 1328 blink::WebScrollbarTheme::updateScrollbars(initial_button_delay,
1322 autoscroll_button_delay, 1329 autoscroll_button_delay,
1323 jump_on_track_click,
1324 preferred_scroller_style, 1330 preferred_scroller_style,
1325 redraw); 1331 redraw);
1326 } 1332 }
1327 #endif 1333 #endif
1328 1334
1329 void RenderThreadImpl::OnMemoryPressure( 1335 void RenderThreadImpl::OnMemoryPressure(
1330 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) { 1336 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
1331 base::allocator::ReleaseFreeMemory(); 1337 base::allocator::ReleaseFreeMemory();
1332 1338
1333 if (memory_pressure_level == 1339 if (memory_pressure_level ==
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 hidden_widget_count_--; 1421 hidden_widget_count_--;
1416 1422
1417 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1423 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1418 return; 1424 return;
1419 } 1425 }
1420 1426
1421 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1427 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1422 } 1428 }
1423 1429
1424 } // namespace content 1430 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698