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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 2695493003: Ensure FrameView scrollbars are updated when changing device emulation modes (Closed)
Patch Set: address comments Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 m_overlayScrollbarHorizontal.get()); 417 m_overlayScrollbarHorizontal.get());
418 if (!m_overlayScrollbarVertical->parent()) 418 if (!m_overlayScrollbarVertical->parent())
419 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get()); 419 m_innerViewportContainerLayer->addChild(m_overlayScrollbarVertical.get());
420 } else { 420 } else {
421 m_overlayScrollbarHorizontal->removeFromParent(); 421 m_overlayScrollbarHorizontal->removeFromParent();
422 m_overlayScrollbarVertical->removeFromParent(); 422 m_overlayScrollbarVertical->removeFromParent();
423 } 423 }
424 424
425 setupScrollbar(WebScrollbar::Horizontal); 425 setupScrollbar(WebScrollbar::Horizontal);
426 setupScrollbar(WebScrollbar::Vertical); 426 setupScrollbar(WebScrollbar::Vertical);
427
428 // Ensure existing FrameView scrollbars are removed if the visual viewport
429 // scrollbars are now supplied, or created if the visual viewport no longer
430 // supplies scrollbars.
431 LocalFrame* frame = mainFrame();
432 if (frame && frame->view())
433 frame->view()->visualViewportScrollbarsChanged();
427 } 434 }
428 435
429 void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation) { 436 void VisualViewport::setupScrollbar(WebScrollbar::Orientation orientation) {
430 bool isHorizontal = orientation == WebScrollbar::Horizontal; 437 bool isHorizontal = orientation == WebScrollbar::Horizontal;
431 GraphicsLayer* scrollbarGraphicsLayer = 438 GraphicsLayer* scrollbarGraphicsLayer =
432 isHorizontal ? m_overlayScrollbarHorizontal.get() 439 isHorizontal ? m_overlayScrollbarHorizontal.get()
433 : m_overlayScrollbarVertical.get(); 440 : m_overlayScrollbarVertical.get();
434 std::unique_ptr<WebScrollbarLayer>& webScrollbarLayer = 441 std::unique_ptr<WebScrollbarLayer>& webScrollbarLayer =
435 isHorizontal ? m_webOverlayScrollbarHorizontal 442 isHorizontal ? m_webOverlayScrollbarHorizontal
436 : m_webOverlayScrollbarVertical; 443 : m_webOverlayScrollbarVertical;
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 } else if (graphicsLayer == m_rootTransformLayer.get()) { 855 } else if (graphicsLayer == m_rootTransformLayer.get()) {
849 name = "Root Transform Layer"; 856 name = "Root Transform Layer";
850 } else { 857 } else {
851 ASSERT_NOT_REACHED(); 858 ASSERT_NOT_REACHED();
852 } 859 }
853 860
854 return name; 861 return name;
855 } 862 }
856 863
857 } // namespace blink 864 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698