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

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

Issue 2873213002: Add PlatformFrameView class. (Closed)
Patch Set: #include PlatformFrameView inside platform.dll Created 3 years, 7 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 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 bool ChromeClientImpl::TabsToLinks() { 550 bool ChromeClientImpl::TabsToLinks() {
551 return web_view_->TabsToLinks(); 551 return web_view_->TabsToLinks();
552 } 552 }
553 553
554 void ChromeClientImpl::InvalidateRect(const IntRect& update_rect) { 554 void ChromeClientImpl::InvalidateRect(const IntRect& update_rect) {
555 if (!update_rect.IsEmpty()) 555 if (!update_rect.IsEmpty())
556 web_view_->InvalidateRect(update_rect); 556 web_view_->InvalidateRect(update_rect);
557 } 557 }
558 558
559 void ChromeClientImpl::ScheduleAnimation(LocalFrame* frame) { 559 void ChromeClientImpl::ScheduleAnimation(
560 frame = &frame->LocalFrameRoot(); 560 const PlatformFrameView* platform_frame_view) {
561 DCHECK(platform_frame_view->IsFrameView());
562 LocalFrame& frame =
563 ToFrameView(platform_frame_view)->GetFrame().LocalFrameRoot();
561 // If the frame is still being created, it might not yet have a WebWidget. 564 // If the frame is still being created, it might not yet have a WebWidget.
562 // FIXME: Is this the right thing to do? Is there a way to avoid having 565 // FIXME: Is this the right thing to do? Is there a way to avoid having
563 // a local frame root that doesn't have a WebWidget? During initialization 566 // a local frame root that doesn't have a WebWidget? During initialization
564 // there is no content to draw so this call serves no purpose. 567 // there is no content to draw so this call serves no purpose.
565 if (WebLocalFrameImpl::FromFrame(frame) && 568 if (WebLocalFrameImpl::FromFrame(&frame) &&
566 WebLocalFrameImpl::FromFrame(frame)->FrameWidget()) 569 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget())
567 WebLocalFrameImpl::FromFrame(frame)->FrameWidget()->ScheduleAnimation(); 570 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->ScheduleAnimation();
568 } 571 }
569 572
570 IntRect ChromeClientImpl::ViewportToScreen( 573 IntRect ChromeClientImpl::ViewportToScreen(
571 const IntRect& rect_in_viewport, 574 const IntRect& rect_in_viewport,
572 const FrameViewBase* frame_view_base) const { 575 const PlatformFrameView* platform_frame_view) const {
573 WebRect screen_rect(rect_in_viewport); 576 WebRect screen_rect(rect_in_viewport);
574 577
575 DCHECK(frame_view_base->IsFrameView()); 578 DCHECK(platform_frame_view->IsFrameView());
576 const FrameView* view = ToFrameView(frame_view_base); 579 const FrameView* view = ToFrameView(platform_frame_view);
577 LocalFrame& frame = view->GetFrame().LocalFrameRoot(); 580 LocalFrame& frame = view->GetFrame().LocalFrameRoot();
578 581
579 WebWidgetClient* client = 582 WebWidgetClient* client =
580 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->Client(); 583 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->Client();
581 584
582 if (client) { 585 if (client) {
583 client->ConvertViewportToWindow(&screen_rect); 586 client->ConvertViewportToWindow(&screen_rect);
584 WebRect view_rect = client->ViewRect(); 587 WebRect view_rect = client->ViewRect();
585 screen_rect.x += view_rect.x; 588 screen_rect.x += view_rect.x;
586 screen_rect.y += view_rect.y; 589 screen_rect.y += view_rect.y;
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 if (RuntimeEnabledFeatures::presentationEnabled()) 1248 if (RuntimeEnabledFeatures::presentationEnabled())
1246 PresentationController::ProvideTo(frame, client->PresentationClient()); 1249 PresentationController::ProvideTo(frame, client->PresentationClient());
1247 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) { 1250 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) {
1248 ProvideAudioOutputDeviceClientTo(frame, 1251 ProvideAudioOutputDeviceClientTo(frame,
1249 new AudioOutputDeviceClientImpl(frame)); 1252 new AudioOutputDeviceClientImpl(frame));
1250 } 1253 }
1251 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher()); 1254 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher());
1252 } 1255 }
1253 1256
1254 } // namespace blink 1257 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/InspectorOverlayAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698