| OLD | NEW |
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "ChromiumBridge.h" | 6 #include "ChromiumBridge.h" |
| 7 | 7 |
| 8 #include "BitmapImage.h" | 8 #include "BitmapImage.h" |
| 9 #include "Cursor.h" | 9 #include "Cursor.h" |
| 10 #include "Frame.h" | 10 #include "Frame.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "Widget.h" | 25 #include "Widget.h" |
| 26 #include <wtf/CurrentTime.h> | 26 #include <wtf/CurrentTime.h> |
| 27 | 27 |
| 28 #undef LOG | 28 #undef LOG |
| 29 #include "base/file_util.h" | 29 #include "base/file_util.h" |
| 30 #include "base/string_util.h" | 30 #include "base/string_util.h" |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "googleurl/src/url_util.h" | 32 #include "googleurl/src/url_util.h" |
| 33 #include "skia/ext/skia_utils_win.h" | 33 #include "skia/ext/skia_utils_win.h" |
| 34 #include "webkit/api/public/WebCursorInfo.h" | 34 #include "webkit/api/public/WebCursorInfo.h" |
| 35 #include "webkit/api/public/WebFrameClient.h" |
| 35 #include "webkit/api/public/WebScreenInfo.h" | 36 #include "webkit/api/public/WebScreenInfo.h" |
| 36 #include "webkit/glue/chrome_client_impl.h" | 37 #include "webkit/glue/chrome_client_impl.h" |
| 37 #include "webkit/glue/glue_util.h" | 38 #include "webkit/glue/glue_util.h" |
| 38 #include "webkit/glue/plugins/plugin_instance.h" | 39 #include "webkit/glue/plugins/plugin_instance.h" |
| 39 #include "webkit/glue/webkit_glue.h" | 40 #include "webkit/glue/webkit_glue.h" |
| 40 #include "webkit/glue/webview_impl.h" | 41 #include "webkit/glue/webview_impl.h" |
| 41 | 42 |
| 42 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 43 #include <windows.h> | 44 #include <windows.h> |
| 44 #include <vssym32.h> | 45 #include <vssym32.h> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } // namespace | 88 } // namespace |
| 88 | 89 |
| 89 namespace WebCore { | 90 namespace WebCore { |
| 90 | 91 |
| 91 // JavaScript ----------------------------------------------------------------- | 92 // JavaScript ----------------------------------------------------------------- |
| 92 | 93 |
| 93 void ChromiumBridge::notifyJSOutOfMemory(Frame* frame) { | 94 void ChromiumBridge::notifyJSOutOfMemory(Frame* frame) { |
| 94 if (!frame) | 95 if (!frame) |
| 95 return; | 96 return; |
| 96 | 97 |
| 97 // Dispatch to the delegate of the view that owns the frame. | 98 WebFrameImpl* webframe = WebFrameImpl::FromFrame(frame); |
| 98 WebViewImpl* webview = WebFrameImpl::FromFrame(frame)->GetWebViewImpl(); | 99 if (!webframe->client()) |
| 99 if (!webview || !webview->delegate()) | |
| 100 return; | 100 return; |
| 101 webview->delegate()->JSOutOfMemory(); | 101 webframe->client()->didExhaustMemoryAvailableForScript(webframe); |
| 102 } | 102 } |
| 103 | 103 |
| 104 // Plugin --------------------------------------------------------------------- | 104 // Plugin --------------------------------------------------------------------- |
| 105 | 105 |
| 106 bool ChromiumBridge::popupsAllowed(NPP npp) { | 106 bool ChromiumBridge::popupsAllowed(NPP npp) { |
| 107 bool popups_allowed = false; | 107 bool popups_allowed = false; |
| 108 if (npp) { | 108 if (npp) { |
| 109 NPAPI::PluginInstance* plugin_instance = | 109 NPAPI::PluginInstance* plugin_instance = |
| 110 reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata); | 110 reinterpret_cast<NPAPI::PluginInstance*>(npp->ndata); |
| 111 if (plugin_instance) | 111 if (plugin_instance) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 chrome_client->SetCursor(webkit_glue::CursorToWebCursorInfo(cursor)); | 166 chrome_client->SetCursor(webkit_glue::CursorToWebCursorInfo(cursor)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void ChromiumBridge::widgetSetFocus(Widget* widget) { | 169 void ChromiumBridge::widgetSetFocus(Widget* widget) { |
| 170 ChromeClientImpl* chrome_client = ToChromeClient(widget); | 170 ChromeClientImpl* chrome_client = ToChromeClient(widget); |
| 171 if (chrome_client) | 171 if (chrome_client) |
| 172 chrome_client->focus(); | 172 chrome_client->focus(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace WebCore | 175 } // namespace WebCore |
| OLD | NEW |