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

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

Issue 2805763004: [System-Keyboard-Lock] Forward navigator functions to RenderFrameHost (Closed)
Patch Set: Resolve review comments Created 3 years, 8 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 14 matching lines...) Expand all
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "web/ChromeClientImpl.h" 32 #include "web/ChromeClientImpl.h"
33 33
34 #include <memory> 34 #include <memory>
35 #include <utility>
36
35 #include "bindings/core/v8/ScriptController.h" 37 #include "bindings/core/v8/ScriptController.h"
36 #include "core/HTMLNames.h" 38 #include "core/HTMLNames.h"
37 #include "core/dom/AXObjectCache.h" 39 #include "core/dom/AXObjectCache.h"
38 #include "core/dom/Document.h" 40 #include "core/dom/Document.h"
39 #include "core/dom/Fullscreen.h" 41 #include "core/dom/Fullscreen.h"
40 #include "core/dom/Node.h" 42 #include "core/dom/Node.h"
41 #include "core/events/UIEventWithKeyState.h" 43 #include "core/events/UIEventWithKeyState.h"
42 #include "core/frame/FrameView.h" 44 #include "core/frame/FrameView.h"
43 #include "core/frame/Settings.h" 45 #include "core/frame/Settings.h"
44 #include "core/frame/VisualViewport.h" 46 #include "core/frame/VisualViewport.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 #include "web/DevToolsEmulator.h" 115 #include "web/DevToolsEmulator.h"
114 #include "web/ExternalDateTimeChooser.h" 116 #include "web/ExternalDateTimeChooser.h"
115 #include "web/ExternalPopupMenu.h" 117 #include "web/ExternalPopupMenu.h"
116 #include "web/IndexedDBClientImpl.h" 118 #include "web/IndexedDBClientImpl.h"
117 #include "web/LocalFileSystemClient.h" 119 #include "web/LocalFileSystemClient.h"
118 #include "web/NavigatorContentUtilsClientImpl.h" 120 #include "web/NavigatorContentUtilsClientImpl.h"
119 #include "web/PopupMenuImpl.h" 121 #include "web/PopupMenuImpl.h"
120 #include "web/WebFileChooserCompletionImpl.h" 122 #include "web/WebFileChooserCompletionImpl.h"
121 #include "web/WebFrameWidgetImpl.h" 123 #include "web/WebFrameWidgetImpl.h"
122 #include "web/WebInputEventConversion.h" 124 #include "web/WebInputEventConversion.h"
125 #include "web/WebKeyLockRequestCompletionImpl.h"
123 #include "web/WebLocalFrameImpl.h" 126 #include "web/WebLocalFrameImpl.h"
124 #include "web/WebPluginContainerImpl.h" 127 #include "web/WebPluginContainerImpl.h"
125 #include "web/WebSettingsImpl.h" 128 #include "web/WebSettingsImpl.h"
126 #include "web/WebViewImpl.h" 129 #include "web/WebViewImpl.h"
127 130
128 namespace blink { 131 namespace blink {
129 132
130 namespace { 133 namespace {
131 134
132 const char* DialogTypeToString(ChromeClient::DialogType dialog_type) { 135 const char* DialogTypeToString(ChromeClient::DialogType dialog_type) {
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 WebConsoleMessage(WebConsoleMessage::kLevelError, message)); 942 WebConsoleMessage(WebConsoleMessage::kLevelError, message));
940 943
941 return false; 944 return false;
942 } 945 }
943 946
944 WebLayerTreeView* ChromeClientImpl::GetWebLayerTreeView(LocalFrame* frame) { 947 WebLayerTreeView* ChromeClientImpl::GetWebLayerTreeView(LocalFrame* frame) {
945 WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(frame); 948 WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(frame);
946 return web_frame->LocalRoot()->FrameWidget()->GetLayerTreeView(); 949 return web_frame->LocalRoot()->FrameWidget()->GetLayerTreeView();
947 } 950 }
948 951
952 void ChromeClientImpl::RequestKeyLock(LocalFrame* frame,
953 PassRefPtr<KeyboardLocker> locker) {
954 // The request always comes from a valid page: the page should always has its
955 // LocalFrame.
956 DCHECK(frame);
957 DCHECK(locker);
958 WebFrameClient* client = WebLocalFrameImpl::FromFrame(frame)->Client();
959 if (!client) {
960 locker->FinishLockRequest(false, WebString::FromASCII("Invalid client."));
961 return;
962 }
963
964 client->RequestKeyLock(
965 locker->web_keycodes(),
966 new WebKeyLockRequestCompletionImpl(std::move(locker)));
967 }
968
969 void ChromeClientImpl::CancelKeyLock(LocalFrame* frame) {
970 DCHECK(frame);
971 WebFrameClient* client = WebLocalFrameImpl::FromFrame(frame)->Client();
972 if (!client) {
973 return;
974 }
975
976 client->CancelKeyLock();
977 }
978
949 void ChromeClientImpl::SetEventListenerProperties( 979 void ChromeClientImpl::SetEventListenerProperties(
950 LocalFrame* frame, 980 LocalFrame* frame,
951 WebEventListenerClass event_class, 981 WebEventListenerClass event_class,
952 WebEventListenerProperties properties) { 982 WebEventListenerProperties properties) {
953 // |frame| might be null if called via TreeScopeAdopter:: 983 // |frame| might be null if called via TreeScopeAdopter::
954 // moveNodeToNewDocument() and the new document has no frame attached. 984 // moveNodeToNewDocument() and the new document has no frame attached.
955 // Since a document without a frame cannot attach one later, it is safe to 985 // Since a document without a frame cannot attach one later, it is safe to
956 // exit early. 986 // exit early.
957 if (!frame) 987 if (!frame)
958 return; 988 return;
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 if (RuntimeEnabledFeatures::presentationEnabled()) 1263 if (RuntimeEnabledFeatures::presentationEnabled())
1234 PresentationController::ProvideTo(frame, client->PresentationClient()); 1264 PresentationController::ProvideTo(frame, client->PresentationClient());
1235 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) { 1265 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) {
1236 ProvideAudioOutputDeviceClientTo(frame, 1266 ProvideAudioOutputDeviceClientTo(frame,
1237 new AudioOutputDeviceClientImpl(frame)); 1267 new AudioOutputDeviceClientImpl(frame));
1238 } 1268 }
1239 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher()); 1269 InstalledAppController::ProvideTo(frame, client->GetRelatedAppsFetcher());
1240 } 1270 }
1241 1271
1242 } // namespace blink 1272 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698