| OLD | NEW |
| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 ChromeClientImpl::~ChromeClientImpl() | 79 ChromeClientImpl::~ChromeClientImpl() |
| 80 { | 80 { |
| 81 } | 81 } |
| 82 | 82 |
| 83 void* ChromeClientImpl::webView() const | 83 void* ChromeClientImpl::webView() const |
| 84 { | 84 { |
| 85 return static_cast<void*>(m_webView); | 85 return static_cast<void*>(m_webView); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void ChromeClientImpl::chromeDestroyed() | |
| 89 { | |
| 90 // Our lifetime is bound to the WebViewImpl. | |
| 91 } | |
| 92 | |
| 93 void ChromeClientImpl::setWindowRect(const FloatRect& r) | 88 void ChromeClientImpl::setWindowRect(const FloatRect& r) |
| 94 { | 89 { |
| 95 if (m_webView->client()) | 90 if (m_webView->client()) |
| 96 m_webView->client()->setWindowRect(IntRect(r)); | 91 m_webView->client()->setWindowRect(IntRect(r)); |
| 97 } | 92 } |
| 98 | 93 |
| 99 FloatRect ChromeClientImpl::windowRect() | 94 FloatRect ChromeClientImpl::windowRect() |
| 100 { | 95 { |
| 101 WebRect rect; | 96 WebRect rect; |
| 102 if (m_webView->client()) | 97 if (m_webView->client()) |
| 103 rect = m_webView->client()->rootWindowRect(); | 98 rect = m_webView->client()->rootWindowRect(); |
| 104 else { | 99 else { |
| 105 // These numbers will be fairly wrong. The window's x/y coordinates will | 100 // These numbers will be fairly wrong. The window's x/y coordinates will |
| 106 // be the top left corner of the screen and the size will be the content | 101 // be the top left corner of the screen and the size will be the content |
| 107 // size instead of the window size. | 102 // size instead of the window size. |
| 108 rect.width = m_webView->size().width; | 103 rect.width = m_webView->size().width; |
| 109 rect.height = m_webView->size().height; | 104 rect.height = m_webView->size().height; |
| 110 } | 105 } |
| 111 return FloatRect(rect); | 106 return FloatRect(rect); |
| 112 } | 107 } |
| 113 | 108 |
| 114 FloatRect ChromeClientImpl::pageRect() | |
| 115 { | |
| 116 // We hide the details of the window's border thickness from the web page by | |
| 117 // simple re-using the window position here. So, from the point-of-view of | |
| 118 // the web page, the window has no border. | |
| 119 return windowRect(); | |
| 120 } | |
| 121 | |
| 122 void ChromeClientImpl::focus() | 109 void ChromeClientImpl::focus() |
| 123 { | 110 { |
| 124 } | 111 } |
| 125 | 112 |
| 126 bool ChromeClientImpl::canTakeFocus(FocusType) | 113 bool ChromeClientImpl::canTakeFocus(FocusType) |
| 127 { | 114 { |
| 128 // For now the browser can always take focus if we're not running layout | 115 // For now the browser can always take focus if we're not running layout |
| 129 // tests. | 116 // tests. |
| 130 return !layoutTestMode(); | 117 return !layoutTestMode(); |
| 131 } | 118 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 155 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); | 142 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); |
| 156 if (webframe && webframe->client()) | 143 if (webframe && webframe->client()) |
| 157 webframe->client()->frameFocused(); | 144 webframe->client()->frameFocused(); |
| 158 } | 145 } |
| 159 | 146 |
| 160 WebNavigationPolicy ChromeClientImpl::getNavigationPolicy() | 147 WebNavigationPolicy ChromeClientImpl::getNavigationPolicy() |
| 161 { | 148 { |
| 162 return WebNavigationPolicyCurrentTab; | 149 return WebNavigationPolicyCurrentTab; |
| 163 } | 150 } |
| 164 | 151 |
| 165 void ChromeClientImpl::show(NavigationPolicy navigationPolicy) | |
| 166 { | |
| 167 } | |
| 168 | |
| 169 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) | 152 bool ChromeClientImpl::shouldReportDetailedMessageForSource(const String& url) |
| 170 { | 153 { |
| 171 WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); | 154 WebLocalFrameImpl* webframe = m_webView->mainFrameImpl(); |
| 172 return webframe->client() && webframe->client()->shouldReportDetailedMessage
ForSource(url); | 155 return webframe->client() && webframe->client()->shouldReportDetailedMessage
ForSource(url); |
| 173 } | 156 } |
| 174 | 157 |
| 175 inline static String messageLevelAsString(MessageLevel level) | 158 inline static String messageLevelAsString(MessageLevel level) |
| 176 { | 159 { |
| 177 switch(level) { | 160 switch(level) { |
| 178 case DebugMessageLevel: | 161 case DebugMessageLevel: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 } | 207 } |
| 225 | 208 |
| 226 return screenRect; | 209 return screenRect; |
| 227 } | 210 } |
| 228 | 211 |
| 229 WebScreenInfo ChromeClientImpl::screenInfo() const | 212 WebScreenInfo ChromeClientImpl::screenInfo() const |
| 230 { | 213 { |
| 231 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn
fo(); | 214 return m_webView->client() ? m_webView->client()->screenInfo() : WebScreenIn
fo(); |
| 232 } | 215 } |
| 233 | 216 |
| 234 void ChromeClientImpl::layoutUpdated(LocalFrame* frame) const | |
| 235 { | |
| 236 m_webView->layoutUpdated(WebLocalFrameImpl::fromFrame(frame)); | |
| 237 } | |
| 238 | |
| 239 void ChromeClientImpl::setCursor(const Cursor& cursor) | 217 void ChromeClientImpl::setCursor(const Cursor& cursor) |
| 240 { | 218 { |
| 241 setCursor(WebCursorInfo(cursor)); | 219 setCursor(WebCursorInfo(cursor)); |
| 242 } | 220 } |
| 243 | 221 |
| 244 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) | 222 void ChromeClientImpl::setCursor(const WebCursorInfo& cursor) |
| 245 { | 223 { |
| 246 } | 224 } |
| 247 | 225 |
| 248 String ChromeClientImpl::acceptLanguages() | 226 String ChromeClientImpl::acceptLanguages() |
| 249 { | 227 { |
| 250 return m_webView->client()->acceptLanguages(); | 228 return m_webView->client()->acceptLanguages(); |
| 251 } | 229 } |
| 252 | 230 |
| 253 void ChromeClientImpl::willSetInputMethodState() | |
| 254 { | |
| 255 } | |
| 256 | |
| 257 } // namespace blink | 231 } // namespace blink |
| OLD | NEW |