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

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

Issue 1467123003: Create base class for common functionality of Web{Local,Remote}Frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 1 month 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 361
362 void WebView::didExitModalLoop() 362 void WebView::didExitModalLoop()
363 { 363 {
364 ASSERT(pageLoadDeferrerStack().size()); 364 ASSERT(pageLoadDeferrerStack().size());
365 pageLoadDeferrerStack().removeLast(); 365 pageLoadDeferrerStack().removeLast();
366 } 366 }
367 367
368 void WebViewImpl::setMainFrame(WebFrame* frame) 368 void WebViewImpl::setMainFrame(WebFrame* frame)
369 { 369 {
370 if (frame->isWebLocalFrame()) { 370 frame->toImplBase()->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, nullAtom);
371 WebLocalFrameImpl* localFrame = toWebLocalFrameImpl(frame);
372 localFrame->initializeCoreFrame(&page()->frameHost(), 0, nullAtom, nullA tom);
373 } else {
374 toWebRemoteFrameImpl(frame)->initializeCoreFrame(&page()->frameHost(), 0 , nullAtom);
375 }
376 } 371 }
377 372
378 void WebViewImpl::setCredentialManagerClient(WebCredentialManagerClient* webCred entialManagerClient) 373 void WebViewImpl::setCredentialManagerClient(WebCredentialManagerClient* webCred entialManagerClient)
379 { 374 {
380 ASSERT(m_page); 375 ASSERT(m_page);
381 provideCredentialManagerClientTo(*m_page, new CredentialManagerClient(webCre dentialManagerClient)); 376 provideCredentialManagerClientTo(*m_page, new CredentialManagerClient(webCre dentialManagerClient));
382 } 377 }
383 378
384 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) 379 void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient)
385 { 380 {
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 if (focusedFrame && focusedFrame->isLocalFrame()) 2798 if (focusedFrame && focusedFrame->isLocalFrame())
2804 toLocalFrame(focusedFrame)->selection().setFocused(false); 2799 toLocalFrame(focusedFrame)->selection().setFocused(false);
2805 return; 2800 return;
2806 } 2801 }
2807 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame(); 2802 LocalFrame* coreFrame = toWebLocalFrameImpl(frame)->frame();
2808 coreFrame->page()->focusController().setFocusedFrame(coreFrame); 2803 coreFrame->page()->focusController().setFocusedFrame(coreFrame);
2809 } 2804 }
2810 2805
2811 void WebViewImpl::focusDocumentView(WebFrame* frame) 2806 void WebViewImpl::focusDocumentView(WebFrame* frame)
2812 { 2807 {
2813 page()->focusController().focusDocumentView(toCoreFrame(frame)); 2808 page()->focusController().focusDocumentView(frame->toImplBase()->frame());
2814 } 2809 }
2815 2810
2816 void WebViewImpl::setInitialFocus(bool reverse) 2811 void WebViewImpl::setInitialFocus(bool reverse)
2817 { 2812 {
2818 if (!m_page) 2813 if (!m_page)
2819 return; 2814 return;
2820 Frame* frame = page()->focusController().focusedOrMainFrame(); 2815 Frame* frame = page()->focusController().focusedOrMainFrame();
2821 if (frame->isLocalFrame()) { 2816 if (frame->isLocalFrame()) {
2822 if (Document* document = toLocalFrame(frame)->document()) 2817 if (Document* document = toLocalFrame(frame)->document())
2823 document->clearFocusedElement(); 2818 document->clearFocusedElement();
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
4458 if (m_pageColorOverlay) 4453 if (m_pageColorOverlay)
4459 m_pageColorOverlay->update(); 4454 m_pageColorOverlay->update();
4460 if (InspectorOverlay* overlay = inspectorOverlay()) { 4455 if (InspectorOverlay* overlay = inspectorOverlay()) {
4461 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4456 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4462 if (inspectorPageOverlay) 4457 if (inspectorPageOverlay)
4463 inspectorPageOverlay->update(); 4458 inspectorPageOverlay->update();
4464 } 4459 }
4465 } 4460 }
4466 4461
4467 } // namespace blink 4462 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp ('k') | third_party/WebKit/Source/web/tests/FrameTestHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698