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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: rebase Created 4 years, 2 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 bool WebLocalFrameImpl::isFocused() const { 598 bool WebLocalFrameImpl::isFocused() const {
599 if (!viewImpl() || !viewImpl()->page()) 599 if (!viewImpl() || !viewImpl()->page())
600 return false; 600 return false;
601 601
602 return this == WebFrame::fromFrame( 602 return this == WebFrame::fromFrame(
603 viewImpl()->page()->focusController().focusedFrame()); 603 viewImpl()->page()->focusController().focusedFrame());
604 } 604 }
605 605
606 WebSize WebLocalFrameImpl::scrollOffset() const { 606 WebSize WebLocalFrameImpl::scrollOffset() const {
607 if (ScrollableArea* scrollableArea = layoutViewportScrollableArea()) 607 if (ScrollableArea* scrollableArea = layoutViewportScrollableArea())
608 return toIntSize(scrollableArea->scrollPosition()); 608 return scrollableArea->scrollOffsetInt();
609 return WebSize(); 609 return WebSize();
610 } 610 }
611 611
612 void WebLocalFrameImpl::setScrollOffset(const WebSize& offset) { 612 void WebLocalFrameImpl::setScrollOffset(const WebSize& offset) {
613 if (ScrollableArea* scrollableArea = layoutViewportScrollableArea()) 613 if (ScrollableArea* scrollableArea = layoutViewportScrollableArea()) {
614 scrollableArea->setScrollPosition(IntPoint(offset.width, offset.height), 614 scrollableArea->setScrollOffset(ScrollOffset(offset.width, offset.height),
615 ProgrammaticScroll); 615 ProgrammaticScroll);
616 }
616 } 617 }
617 618
618 WebSize WebLocalFrameImpl::contentsSize() const { 619 WebSize WebLocalFrameImpl::contentsSize() const {
619 if (FrameView* view = frameView()) 620 if (FrameView* view = frameView())
620 return view->contentsSize(); 621 return view->contentsSize();
621 return WebSize(); 622 return WebSize();
622 } 623 }
623 624
624 bool WebLocalFrameImpl::hasVisibleContent() const { 625 bool WebLocalFrameImpl::hasVisibleContent() const {
625 if (LayoutPart* layoutObject = frame()->ownerLayoutObject()) { 626 if (LayoutPart* layoutObject = frame()->ownerLayoutObject()) {
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
2328 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; 2329 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol;
2329 } else if (metric == "wasAlternateProtocolAvailable") { 2330 } else if (metric == "wasAlternateProtocolAvailable") {
2330 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; 2331 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable;
2331 } else if (metric == "connectionInfo") { 2332 } else if (metric == "connectionInfo") {
2332 feature = UseCounter::ChromeLoadTimesConnectionInfo; 2333 feature = UseCounter::ChromeLoadTimesConnectionInfo;
2333 } 2334 }
2334 UseCounter::count(frame(), feature); 2335 UseCounter::count(frame(), feature);
2335 } 2336 }
2336 2337
2337 } // namespace blink 2338 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698