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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2898423002: Reset scroll and scale while toggling "Request desktop site" (Closed)
Patch Set: [WIP] Page is zoomed in while toggling "Request desktop site" Created 3 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "core/html/HTMLPlugInElement.h" 72 #include "core/html/HTMLPlugInElement.h"
73 #include "core/html/HTMLTextAreaElement.h" 73 #include "core/html/HTMLTextAreaElement.h"
74 #include "core/input/ContextMenuAllowedScope.h" 74 #include "core/input/ContextMenuAllowedScope.h"
75 #include "core/input/EventHandler.h" 75 #include "core/input/EventHandler.h"
76 #include "core/input/TouchActionUtil.h" 76 #include "core/input/TouchActionUtil.h"
77 #include "core/inspector/DevToolsEmulator.h" 77 #include "core/inspector/DevToolsEmulator.h"
78 #include "core/layout/LayoutPart.h" 78 #include "core/layout/LayoutPart.h"
79 #include "core/layout/TextAutosizer.h" 79 #include "core/layout/TextAutosizer.h"
80 #include "core/layout/api/LayoutViewItem.h" 80 #include "core/layout/api/LayoutViewItem.h"
81 #include "core/layout/compositing/PaintLayerCompositor.h" 81 #include "core/layout/compositing/PaintLayerCompositor.h"
82 #include "core/loader/DocumentLoader.h"
82 #include "core/loader/FrameLoadRequest.h" 83 #include "core/loader/FrameLoadRequest.h"
83 #include "core/loader/FrameLoader.h" 84 #include "core/loader/FrameLoader.h"
84 #include "core/loader/FrameLoaderStateMachine.h" 85 #include "core/loader/FrameLoaderStateMachine.h"
85 #include "core/page/ContextMenuController.h" 86 #include "core/page/ContextMenuController.h"
86 #include "core/page/ContextMenuProvider.h" 87 #include "core/page/ContextMenuProvider.h"
87 #include "core/page/FocusController.h" 88 #include "core/page/FocusController.h"
88 #include "core/page/FrameTree.h" 89 #include "core/page/FrameTree.h"
89 #include "core/page/Page.h" 90 #include "core/page/Page.h"
90 #include "core/page/PagePopupClient.h" 91 #include "core/page/PagePopupClient.h"
91 #include "core/page/PointerLockController.h" 92 #include "core/page/PointerLockController.h"
(...skipping 3215 matching lines...) Expand 10 before | Expand all | Expand 10 after
3307 3308
3308 if (LocalFrameView* frame_view = 3309 if (LocalFrameView* frame_view =
3309 ToLocalFrame(GetPage()->MainFrame())->View()) { 3310 ToLocalFrame(GetPage()->MainFrame())->View()) {
3310 ScrollableArea* scrollable_area = 3311 ScrollableArea* scrollable_area =
3311 frame_view->LayoutViewportScrollableArea(); 3312 frame_view->LayoutViewportScrollableArea();
3312 3313
3313 if (!scrollable_area->GetScrollOffset().IsZero()) 3314 if (!scrollable_area->GetScrollOffset().IsZero())
3314 scrollable_area->SetScrollOffset(ScrollOffset(), kProgrammaticScroll); 3315 scrollable_area->SetScrollOffset(ScrollOffset(), kProgrammaticScroll);
3315 } 3316 }
3316 3317
3318 if (Document* document = ToLocalFrame(GetPage()->MainFrame())->GetDocument())
3319 document->Loader()->GetHistoryItem()->SetDidSaveScrollOrScaleState(false);
aelias_OOO_until_Jul13 2017/06/06 02:57:30 This seems reasonable to me. Could you add a unit
3320
3317 GetPageScaleConstraintsSet().SetNeedsReset(true); 3321 GetPageScaleConstraintsSet().SetNeedsReset(true);
3318 } 3322 }
3319 3323
3320 void WebViewImpl::PerformMediaPlayerAction(const WebMediaPlayerAction& action, 3324 void WebViewImpl::PerformMediaPlayerAction(const WebMediaPlayerAction& action,
3321 const WebPoint& location) { 3325 const WebPoint& location) {
3322 HitTestResult result = HitTestResultForViewportPos(location); 3326 HitTestResult result = HitTestResultForViewportPos(location);
3323 Node* node = result.InnerNode(); 3327 Node* node = result.InnerNode();
3324 if (!isHTMLVideoElement(*node) && !isHTMLAudioElement(*node)) 3328 if (!isHTMLVideoElement(*node) && !isHTMLAudioElement(*node))
3325 return; 3329 return;
3326 3330
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
4139 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4143 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4140 return nullptr; 4144 return nullptr;
4141 return focused_frame; 4145 return focused_frame;
4142 } 4146 }
4143 4147
4144 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4148 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4145 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4149 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4146 } 4150 }
4147 4151
4148 } // namespace blink 4152 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698