| OLD | NEW |
| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void WebView::WillEnterModalLoop() { | 299 void WebView::WillEnterModalLoop() { |
| 300 PageSuspenderStack().push_back(WTF::MakeUnique<ScopedPageSuspender>()); | 300 PageSuspenderStack().push_back(WTF::MakeUnique<ScopedPageSuspender>()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void WebView::DidExitModalLoop() { | 303 void WebView::DidExitModalLoop() { |
| 304 DCHECK(PageSuspenderStack().size()); | 304 DCHECK(PageSuspenderStack().size()); |
| 305 PageSuspenderStack().pop_back(); | 305 PageSuspenderStack().pop_back(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void WebViewImpl::SetMainFrame(WebFrame* frame) { | 308 void WebViewImpl::SetMainFrame(WebFrame* frame) { |
| 309 frame->ToImplBase()->InitializeCoreFrame(*GetPage(), 0, g_null_atom); | 309 frame->InitializeCoreFrame(*GetPage()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void WebViewImpl::SetCredentialManagerClient( | 312 void WebViewImpl::SetCredentialManagerClient( |
| 313 WebCredentialManagerClient* web_credential_manager_client) { | 313 WebCredentialManagerClient* web_credential_manager_client) { |
| 314 DCHECK(page_); | 314 DCHECK(page_); |
| 315 ProvideCredentialManagerClientTo( | 315 ProvideCredentialManagerClientTo( |
| 316 *page_, new CredentialManagerClient(web_credential_manager_client)); | 316 *page_, new CredentialManagerClient(web_credential_manager_client)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 void WebViewImpl::SetPrerendererClient( | 319 void WebViewImpl::SetPrerendererClient( |
| (...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2672 } | 2672 } |
| 2673 LocalFrame* core_frame = ToWebLocalFrameImpl(frame)->GetFrame(); | 2673 LocalFrame* core_frame = ToWebLocalFrameImpl(frame)->GetFrame(); |
| 2674 core_frame->GetPage()->GetFocusController().SetFocusedFrame(core_frame); | 2674 core_frame->GetPage()->GetFocusController().SetFocusedFrame(core_frame); |
| 2675 } | 2675 } |
| 2676 | 2676 |
| 2677 void WebViewImpl::FocusDocumentView(WebFrame* frame) { | 2677 void WebViewImpl::FocusDocumentView(WebFrame* frame) { |
| 2678 // This is currently only used when replicating focus changes for | 2678 // This is currently only used when replicating focus changes for |
| 2679 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending | 2679 // cross-process frames, and |notifyEmbedder| is disabled to avoid sending |
| 2680 // duplicate frameFocused updates from FocusController to the browser | 2680 // duplicate frameFocused updates from FocusController to the browser |
| 2681 // process, which already knows the latest focused frame. | 2681 // process, which already knows the latest focused frame. |
| 2682 GetPage()->GetFocusController().FocusDocumentView( | 2682 GetPage()->GetFocusController().FocusDocumentView(frame->GetFrame(), |
| 2683 frame->ToImplBase()->GetFrame(), false /* notifyEmbedder */); | 2683 false /* notifyEmbedder */); |
| 2684 } | 2684 } |
| 2685 | 2685 |
| 2686 void WebViewImpl::SetInitialFocus(bool reverse) { | 2686 void WebViewImpl::SetInitialFocus(bool reverse) { |
| 2687 if (!page_) | 2687 if (!page_) |
| 2688 return; | 2688 return; |
| 2689 Frame* frame = GetPage()->GetFocusController().FocusedOrMainFrame(); | 2689 Frame* frame = GetPage()->GetFocusController().FocusedOrMainFrame(); |
| 2690 if (frame->IsLocalFrame()) { | 2690 if (frame->IsLocalFrame()) { |
| 2691 if (Document* document = ToLocalFrame(frame)->GetDocument()) | 2691 if (Document* document = ToLocalFrame(frame)->GetDocument()) |
| 2692 document->ClearFocusedElement(); | 2692 document->ClearFocusedElement(); |
| 2693 } | 2693 } |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4157 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4157 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4158 return nullptr; | 4158 return nullptr; |
| 4159 return focused_frame; | 4159 return focused_frame; |
| 4160 } | 4160 } |
| 4161 | 4161 |
| 4162 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4162 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4163 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4163 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4164 } | 4164 } |
| 4165 | 4165 |
| 4166 } // namespace blink | 4166 } // namespace blink |
| OLD | NEW |