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

Side by Side Diff: content/common/page_state_serialization.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 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
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/common/page_state_serialization.h" 5 #include "content/common/page_state_serialization.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // it was on a private branch. 599 // it was on a private branch.
600 ReadReal(obj); 600 ReadReal(obj);
601 ReadBoolean(obj); 601 ReadBoolean(obj);
602 602
603 // In this version, page_scale_factor included device_scale_factor and 603 // In this version, page_scale_factor included device_scale_factor and
604 // scroll offsets were premultiplied by pageScaleFactor. 604 // scroll offsets were premultiplied by pageScaleFactor.
605 if (state->page_scale_factor) { 605 if (state->page_scale_factor) {
606 float device_scale_factor = g_device_scale_factor_for_testing; 606 float device_scale_factor = g_device_scale_factor_for_testing;
607 if (!device_scale_factor) { 607 if (!device_scale_factor) {
608 device_scale_factor = 608 device_scale_factor =
609 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay(). 609 gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
610 device_scale_factor();
611 } 610 }
612 state->scroll_offset = 611 state->scroll_offset =
613 gfx::Point(state->scroll_offset.x() / state->page_scale_factor, 612 gfx::Point(state->scroll_offset.x() / state->page_scale_factor,
614 state->scroll_offset.y() / state->page_scale_factor); 613 state->scroll_offset.y() / state->page_scale_factor);
615 state->page_scale_factor /= device_scale_factor; 614 state->page_scale_factor /= device_scale_factor;
616 } 615 }
617 } 616 }
618 #endif 617 #endif
619 618
620 // Subitems 619 // Subitems
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 float device_scale_factor, 751 float device_scale_factor,
753 ExplodedPageState* exploded) { 752 ExplodedPageState* exploded) {
754 g_device_scale_factor_for_testing = device_scale_factor; 753 g_device_scale_factor_for_testing = device_scale_factor;
755 bool rv = DecodePageState(encoded, exploded); 754 bool rv = DecodePageState(encoded, exploded);
756 g_device_scale_factor_for_testing = 0.0; 755 g_device_scale_factor_for_testing = 0.0;
757 return rv; 756 return rv;
758 } 757 }
759 #endif 758 #endif
760 759
761 } // namespace content 760 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura.cc ('k') | content/shell/browser/shell_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698