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

Side by Side Diff: sky/engine/web/WebLocalFrameImpl.cpp

Issue 646273006: Get rid of ScrollView. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 void WebLocalFrameImpl::setScrollOffset(const WebSize& offset) 255 void WebLocalFrameImpl::setScrollOffset(const WebSize& offset)
256 { 256 {
257 if (FrameView* view = frameView()) 257 if (FrameView* view = frameView())
258 view->setScrollOffset(IntPoint(offset.width, offset.height)); 258 view->setScrollOffset(IntPoint(offset.width, offset.height));
259 } 259 }
260 260
261 WebSize WebLocalFrameImpl::contentsSize() const 261 WebSize WebLocalFrameImpl::contentsSize() const
262 { 262 {
263 return frame()->view()->contentsSize(); 263 return frame()->view()->size();
264 } 264 }
265 265
266 bool WebLocalFrameImpl::hasVisibleContent() const 266 bool WebLocalFrameImpl::hasVisibleContent() const
267 { 267 {
268 return frame()->view()->visibleWidth() > 0 && frame()->view()->visibleHeight () > 0; 268 return frame()->view()->width() > 0 && frame()->view()->height() > 0;
269 } 269 }
270 270
271 WebRect WebLocalFrameImpl::visibleContentRect() const 271 WebRect WebLocalFrameImpl::visibleContentRect() const
272 { 272 {
273 return frame()->view()->visibleContentRect(); 273 return frame()->view()->frameRect();
274 } 274 }
275 275
276 bool WebLocalFrameImpl::hasHorizontalScrollbar() const 276 bool WebLocalFrameImpl::hasHorizontalScrollbar() const
277 { 277 {
278 return frame() && frame()->view() && frame()->view()->horizontalScrollbar(); 278 // FIXME(sky): Remove
279 return false;
279 } 280 }
280 281
281 bool WebLocalFrameImpl::hasVerticalScrollbar() const 282 bool WebLocalFrameImpl::hasVerticalScrollbar() const
282 { 283 {
283 return frame() && frame()->view() && frame()->view()->verticalScrollbar(); 284 // FIXME(sky): Remove
285 return false;
284 } 286 }
285 287
286 WebView* WebLocalFrameImpl::view() const 288 WebView* WebLocalFrameImpl::view() const
287 { 289 {
288 return viewImpl(); 290 return viewImpl();
289 } 291 }
290 292
291 WebDocument WebLocalFrameImpl::document() const 293 WebDocument WebLocalFrameImpl::document() const
292 { 294 {
293 if (!frame() || !frame()->document()) 295 if (!frame() || !frame()->document())
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 828 }
827 829
828 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor) 830 void WebLocalFrameImpl::setInputEventsTransformForEmulation(const IntSize& offse t, float contentScaleFactor)
829 { 831 {
830 m_inputEventsOffsetForEmulation = offset; 832 m_inputEventsOffsetForEmulation = offset;
831 m_inputEventsScaleFactorForEmulation = contentScaleFactor; 833 m_inputEventsScaleFactorForEmulation = contentScaleFactor;
832 if (frame()->view()) 834 if (frame()->view())
833 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation); 835 frame()->view()->setInputEventsTransformForEmulation(m_inputEventsOffset ForEmulation, m_inputEventsScaleFactorForEmulation);
834 } 836 }
835 837
836 void WebLocalFrameImpl::invalidateScrollbar() const
837 {
838 ASSERT(frame() && frame()->view());
839 FrameView* view = frame()->view();
840 // Invalidate the vertical scroll bar region for the view.
841 Scrollbar* scrollbar = view->verticalScrollbar();
842 if (scrollbar)
843 scrollbar->invalidate();
844 }
845
846 void WebLocalFrameImpl::invalidateAll() const 838 void WebLocalFrameImpl::invalidateAll() const
847 { 839 {
848 ASSERT(frame() && frame()->view()); 840 ASSERT(frame() && frame()->view());
849 FrameView* view = frame()->view(); 841 FrameView* view = frame()->view();
850 view->invalidateRect(view->frameRect()); 842 view->invalidateRect(view->frameRect());
851 invalidateScrollbar();
852 } 843 }
853 844
854 } // namespace blink 845 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698