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

Side by Side Diff: sky/engine/web/ChromeClientImpl.cpp

Issue 880643007: Merge WebWidgetClient into WebViewClient. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/web/ChromeClientImpl.h ('k') | sky/viewer/document_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "sky/engine/public/platform/WebCursorInfo.h" 53 #include "sky/engine/public/platform/WebCursorInfo.h"
54 #include "sky/engine/public/platform/WebInputEvent.h" 54 #include "sky/engine/public/platform/WebInputEvent.h"
55 #include "sky/engine/public/platform/WebRect.h" 55 #include "sky/engine/public/platform/WebRect.h"
56 #include "sky/engine/public/platform/WebURLRequest.h" 56 #include "sky/engine/public/platform/WebURLRequest.h"
57 #include "sky/engine/public/web/Sky.h" 57 #include "sky/engine/public/web/Sky.h"
58 #include "sky/engine/public/web/WebConsoleMessage.h" 58 #include "sky/engine/public/web/WebConsoleMessage.h"
59 #include "sky/engine/public/web/WebFrameClient.h" 59 #include "sky/engine/public/web/WebFrameClient.h"
60 #include "sky/engine/public/web/WebNode.h" 60 #include "sky/engine/public/web/WebNode.h"
61 #include "sky/engine/public/web/WebSettings.h" 61 #include "sky/engine/public/web/WebSettings.h"
62 #include "sky/engine/public/web/WebTextDirection.h" 62 #include "sky/engine/public/web/WebTextDirection.h"
63 #include "sky/engine/public/web/WebTouchAction.h"
64 #include "sky/engine/public/web/WebViewClient.h" 63 #include "sky/engine/public/web/WebViewClient.h"
65 #include "sky/engine/web/WebLocalFrameImpl.h" 64 #include "sky/engine/web/WebLocalFrameImpl.h"
66 #include "sky/engine/web/WebSettingsImpl.h" 65 #include "sky/engine/web/WebSettingsImpl.h"
67 #include "sky/engine/web/WebViewImpl.h" 66 #include "sky/engine/web/WebViewImpl.h"
68 #include "sky/engine/wtf/text/CString.h" 67 #include "sky/engine/wtf/text/CString.h"
69 #include "sky/engine/wtf/text/StringBuilder.h" 68 #include "sky/engine/wtf/text/StringBuilder.h"
70 #include "sky/engine/wtf/text/StringConcatenate.h" 69 #include "sky/engine/wtf/text/StringConcatenate.h"
71 #include "sky/engine/wtf/unicode/CharacterNames.h" 70 #include "sky/engine/wtf/unicode/CharacterNames.h"
72 71
73 namespace blink { 72 namespace blink {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 FloatRect ChromeClientImpl::pageRect() 114 FloatRect ChromeClientImpl::pageRect()
116 { 115 {
117 // We hide the details of the window's border thickness from the web page by 116 // We hide the details of the window's border thickness from the web page by
118 // simple re-using the window position here. So, from the point-of-view of 117 // simple re-using the window position here. So, from the point-of-view of
119 // the web page, the window has no border. 118 // the web page, the window has no border.
120 return windowRect(); 119 return windowRect();
121 } 120 }
122 121
123 void ChromeClientImpl::focus() 122 void ChromeClientImpl::focus()
124 { 123 {
125 if (m_webView->client())
126 m_webView->client()->didFocus();
127 } 124 }
128 125
129 bool ChromeClientImpl::canTakeFocus(FocusType) 126 bool ChromeClientImpl::canTakeFocus(FocusType)
130 { 127 {
131 // For now the browser can always take focus if we're not running layout 128 // For now the browser can always take focus if we're not running layout
132 // tests. 129 // tests.
133 return !layoutTestMode(); 130 return !layoutTestMode();
134 } 131 }
135 132
136 void ChromeClientImpl::takeFocus(FocusType type) 133 void ChromeClientImpl::takeFocus(FocusType type)
(...skipping 23 matching lines...) Expand all
160 webframe->client()->frameFocused(); 157 webframe->client()->frameFocused();
161 } 158 }
162 159
163 WebNavigationPolicy ChromeClientImpl::getNavigationPolicy() 160 WebNavigationPolicy ChromeClientImpl::getNavigationPolicy()
164 { 161 {
165 return WebNavigationPolicyCurrentTab; 162 return WebNavigationPolicyCurrentTab;
166 } 163 }
167 164
168 void ChromeClientImpl::show(NavigationPolicy navigationPolicy) 165 void ChromeClientImpl::show(NavigationPolicy navigationPolicy)
169 { 166 {
170 if (!m_webView->client())
171 return;
172
173 WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPoli cy);
174 if (policy == WebNavigationPolicyIgnore)
175 policy = getNavigationPolicy();
176 m_webView->client()->show(policy);
177 } 167 }
178 168
179 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) 169 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url)
180 { 170 {
181 WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); 171 WebLocalFrameImpl* webframe = m_webView->mainFrameImpl();
182 return webframe->client() && webframe->client()->shouldReportDetailedMessage ForSource(url); 172 return webframe->client() && webframe->client()->shouldReportDetailedMessage ForSource(url);
183 } 173 }
184 174
185 inline static String messageLevelAsString(MessageLevel level) 175 inline static String messageLevelAsString(MessageLevel level)
186 { 176 {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); 236 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame));
247 } 237 }
248 238
249 void ChromeClientImpl::setCursor(const Cursor& cursor) 239 void ChromeClientImpl::setCursor(const Cursor& cursor)
250 { 240 {
251 setCursor(WebCursorInfo(cursor)); 241 setCursor(WebCursorInfo(cursor));
252 } 242 }
253 243
254 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) 244 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor)
255 { 245 {
256 if (m_webView->client())
257 m_webView->client()->didChangeCursor(cursor);
258 } 246 }
259 247
260 String ChromeClientImpl::acceptLanguages() 248 String ChromeClientImpl::acceptLanguages()
261 { 249 {
262 return m_webView->client()->acceptLanguages(); 250 return m_webView->client()->acceptLanguages();
263 } 251 }
264 252
265 void ChromeClientImpl::setTouchAction(TouchAction touchAction)
266 {
267 if (WebViewClient* client = m_webView->client()) {
268 WebTouchAction webTouchAction = static_cast<WebTouchAction>(touchAction) ;
269 client->setTouchAction(webTouchAction);
270 }
271 }
272
273 void ChromeClientImpl::willSetInputMethodState() 253 void ChromeClientImpl::willSetInputMethodState()
274 { 254 {
275 if (m_webView->client())
276 m_webView->client()->resetInputMethod();
277 }
278
279 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput()
280 {
281 if (m_webView->client())
282 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput();
283 }
284
285 void ChromeClientImpl::showImeIfNeeded()
286 {
287 if (m_webView->client())
288 m_webView->client()->showImeIfNeeded();
289 } 255 }
290 256
291 } // namespace blink 257 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/web/ChromeClientImpl.h ('k') | sky/viewer/document_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698