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

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

Issue 2868173002: Add PlatformLocalFrame class. (Closed)
Patch Set: this time with new file included 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 PlatformLocalFrame* platform_frame) {
561 DCHECK(platform_frame->IsLocalFrame());
562 LocalFrame& frame = ToLocalFrame(platform_frame)->LocalFrameRoot();
561 // If the frame is still being created, it might not yet have a WebWidget. 563 // 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 564 // 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 565 // 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. 566 // there is no content to draw so this call serves no purpose.
565 if (WebLocalFrameImpl::FromFrame(frame) && 567 if (WebLocalFrameImpl::FromFrame(&frame) &&
566 WebLocalFrameImpl::FromFrame(frame)->FrameWidget()) 568 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget())
567 WebLocalFrameImpl::FromFrame(frame)->FrameWidget()->ScheduleAnimation(); 569 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->ScheduleAnimation();
568 } 570 }
569 571
570 IntRect ChromeClientImpl::ViewportToScreen( 572 IntRect ChromeClientImpl::ViewportToScreen(
571 const IntRect& rect_in_viewport, 573 const IntRect& rect_in_viewport,
572 const FrameViewBase* frame_view_base) const { 574 const PlatformLocalFrame* platform_frame) const {
573 WebRect screen_rect(rect_in_viewport); 575 WebRect screen_rect(rect_in_viewport);
574 576
575 DCHECK(frame_view_base->IsFrameView()); 577 DCHECK(platform_frame->IsLocalFrame());
576 const FrameView* view = ToFrameView(frame_view_base); 578 LocalFrame& frame = ToLocalFrame(platform_frame)->LocalFrameRoot();
577 LocalFrame& frame = view->GetFrame().LocalFrameRoot();
578 579
579 WebWidgetClient* client = 580 WebWidgetClient* client =
580 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->Client(); 581 WebLocalFrameImpl::FromFrame(&frame)->FrameWidget()->Client();
581 582
582 if (client) { 583 if (client) {
583 client->ConvertViewportToWindow(&screen_rect); 584 client->ConvertViewportToWindow(&screen_rect);
584 WebRect view_rect = client->ViewRect(); 585 WebRect view_rect = client->ViewRect();
585 screen_rect.x += view_rect.x; 586 screen_rect.x += view_rect.x;
586 screen_rect.y += view_rect.y; 587 screen_rect.y += view_rect.y;
587 } 588 }
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 if (RuntimeEnabledFeatures::presentationEnabled()) 1246 if (RuntimeEnabledFeatures::presentationEnabled())
1246 PresentationController::ProvideTo(frame, client->PresentationClient()); 1247 PresentationController::ProvideTo(frame, client->PresentationClient());
1247 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) { 1248 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) {
1248 ProvideAudioOutputDeviceClientTo(frame, 1249 ProvideAudioOutputDeviceClientTo(frame,
1249 new AudioOutputDeviceClientImpl(frame)); 1250 new AudioOutputDeviceClientImpl(frame));
1250 } 1251 }
1251 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher()); 1252 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher());
1252 } 1253 }
1253 1254
1254 } // namespace blink 1255 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698