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

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

Issue 53493003: Turn on useUnfortunateSynchronousResizeMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browsertests. Created 7 years, 1 month 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
« no previous file with comments | « content/renderer/resizing_mode_selector.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resizing_mode_selector.h" 5 #include "content/renderer/resizing_mode_selector.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "content/renderer/render_thread_impl.h" 8 #include "content/renderer/render_thread_impl.h"
9 #include "content/renderer/render_widget.h" 9 #include "content/renderer/render_widget.h"
10 #include "third_party/WebKit/public/web/WebScreenInfo.h" 10 #include "third_party/WebKit/public/web/WebScreenInfo.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 ResizingModeSelector::ResizingModeSelector() 14 ResizingModeSelector::ResizingModeSelector() : is_synchronous_mode_(false) {}
15 : is_synchronous_mode_(false) { 15
16 // TODO(dglazkov): Remove this re-initialization once the transition to 16 bool ResizingModeSelector::NeverUsesSynchronousResize() const {
17 // useUnfortunateAsynchronousResizeMode is complete. 17 return !RenderThreadImpl::current() || // can be NULL when in unit tests
18 // See http://crbug.com/309760 for details. 18 !RenderThreadImpl::current()->layout_test_mode();
19 is_synchronous_mode_ = RenderThreadImpl::current() &&
20 RenderThreadImpl::current()->layout_test_mode();
21 } 19 }
22 20
23 bool ResizingModeSelector::ShouldAbortOnResize( 21 bool ResizingModeSelector::ShouldAbortOnResize(
24 RenderWidget* widget, 22 RenderWidget* widget,
25 const ViewMsg_Resize_Params& params) { 23 const ViewMsg_Resize_Params& params) {
26 return is_synchronous_mode_ && 24 return is_synchronous_mode_ &&
27 params.is_fullscreen == widget->is_fullscreen() && 25 params.is_fullscreen == widget->is_fullscreen() &&
28 params.screen_info.deviceScaleFactor == 26 params.screen_info.deviceScaleFactor ==
29 widget->screenInfo().deviceScaleFactor; 27 widget->screenInfo().deviceScaleFactor;
30 } 28 }
31 29
32 void ResizingModeSelector::set_is_synchronous_mode(bool mode) { 30 void ResizingModeSelector::set_is_synchronous_mode(bool mode) {
33 // TODO(dglazkov): Actually set is_synchronous_mode_ once the transition to 31 is_synchronous_mode_ = mode;
34 // useUnfortunateAsynchronousResizeMode is complete.
35 } 32 }
36 33
37 bool ResizingModeSelector::is_synchronous_mode() const { 34 bool ResizingModeSelector::is_synchronous_mode() const {
38 return is_synchronous_mode_; 35 return is_synchronous_mode_;
39 } 36 }
40 37
41 } // namespace content 38 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/resizing_mode_selector.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698