Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 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 "sky/engine/config.h" | 32 #include "sky/engine/config.h" |
| 33 #include "sky/engine/web/ChromeClientImpl.h" | 33 #include "sky/engine/web/ChromeClientImpl.h" |
| 34 | 34 |
| 35 #include "base/logging.h" | |
| 35 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 36 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 36 #include "sky/engine/bindings/core/v8/ScriptController.h" | 37 #include "sky/engine/bindings/core/v8/ScriptController.h" |
| 37 #include "sky/engine/core/dom/Document.h" | 38 #include "sky/engine/core/dom/Document.h" |
| 38 #include "sky/engine/core/dom/Element.h" | 39 #include "sky/engine/core/dom/Element.h" |
| 39 #include "sky/engine/core/dom/Node.h" | 40 #include "sky/engine/core/dom/Node.h" |
| 40 #include "sky/engine/core/events/KeyboardEvent.h" | 41 #include "sky/engine/core/events/KeyboardEvent.h" |
| 41 #include "sky/engine/core/frame/Console.h" | 42 #include "sky/engine/core/frame/Console.h" |
| 42 #include "sky/engine/core/frame/FrameView.h" | 43 #include "sky/engine/core/frame/FrameView.h" |
| 43 #include "sky/engine/core/frame/Settings.h" | 44 #include "sky/engine/core/frame/Settings.h" |
| 44 #include "sky/engine/core/page/Page.h" | 45 #include "sky/engine/core/page/Page.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 case InfoMessageLevel: | 197 case InfoMessageLevel: |
| 197 return "INFO"; | 198 return "INFO"; |
| 198 } | 199 } |
| 199 return "MESSAGE:"; | 200 return "MESSAGE:"; |
| 200 } | 201 } |
| 201 | 202 |
| 202 | 203 |
| 203 void ChromeClientImpl::addMessageToConsole(LocalFrame* localFrame, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const S tring& sourceID, const String& stackTrace) | 204 void ChromeClientImpl::addMessageToConsole(LocalFrame* localFrame, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const S tring& sourceID, const String& stackTrace) |
| 204 { | 205 { |
| 205 | 206 |
| 206 if (level == ErrorMessageLevel) | 207 if (level == ErrorMessageLevel) { |
| 207 printf("ERROR: %s \nSOURCE: %s:%u\n", message.utf8().data(), sourceID.ut f8().data(), lineNumber); | 208 printf("ERROR: %s \nSOURCE: %s:%u\n", message.utf8().data(), sourceID.ut f8().data(), lineNumber); |
| 208 else | 209 } else { |
| 210 #if OS(ANDROID) | |
| 211 LOG(INFO) << "CONSOLE: " << messageLevelAsString(level).utf8().data() | |
|
esprehn
2015/01/27 01:31:42
Why can't we just LOG() all the time?
abarth-chromium
2015/01/27 01:33:28
It just looks ugly on Linux. There's a bunch of e
| |
| 212 << ": " << message.utf8().data(); | |
| 213 #else | |
| 209 printf("CONSOLE: %s: %s\n", messageLevelAsString(level).utf8().data(), m essage.utf8().data()); | 214 printf("CONSOLE: %s: %s\n", messageLevelAsString(level).utf8().data(), m essage.utf8().data()); |
| 215 #endif | |
| 216 } | |
| 210 fflush(stdout); | 217 fflush(stdout); |
| 211 | 218 |
| 212 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(localFrame); | 219 WebLocalFrameImpl* frame = WebLocalFrameImpl::fromFrame(localFrame); |
| 213 if (frame && frame->client()) { | 220 if (frame && frame->client()) { |
| 214 frame->client()->didAddMessageToConsole( | 221 frame->client()->didAddMessageToConsole( |
| 215 WebConsoleMessage(static_cast<WebConsoleMessage::Level>(level), mess age), | 222 WebConsoleMessage(static_cast<WebConsoleMessage::Level>(level), mess age), |
| 216 sourceID, | 223 sourceID, |
| 217 lineNumber, | 224 lineNumber, |
| 218 stackTrace); | 225 stackTrace); |
| 219 } | 226 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); | 289 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); |
| 283 } | 290 } |
| 284 | 291 |
| 285 void ChromeClientImpl::showImeIfNeeded() | 292 void ChromeClientImpl::showImeIfNeeded() |
| 286 { | 293 { |
| 287 if (m_webView->client()) | 294 if (m_webView->client()) |
| 288 m_webView->client()->showImeIfNeeded(); | 295 m_webView->client()->showImeIfNeeded(); |
| 289 } | 296 } |
| 290 | 297 |
| 291 } // namespace blink | 298 } // namespace blink |
| OLD | NEW |