OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 | 918 |
919 base::SharedMemory memory(shared_memory, true); | 919 base::SharedMemory memory(shared_memory, true); |
920 if (!memory.Map(size)) { | 920 if (!memory.Map(size)) { |
921 NOTREACHED(); | 921 NOTREACHED(); |
922 return; | 922 return; |
923 } | 923 } |
924 | 924 |
925 #if defined(OS_WIN) | 925 #if defined(OS_WIN) |
926 scoped_ptr<printing::NativeMetafile> metafile( | 926 scoped_ptr<printing::NativeMetafile> metafile( |
927 printing::NativeMetafileFactory::CreateMetafile()); | 927 printing::NativeMetafileFactory::CreateMetafile()); |
928 if (!metafile->Init(memory.memory(), size)) { | 928 if (!metafile->InitFromData(memory.memory(), size)) { |
929 NOTREACHED(); | 929 NOTREACHED(); |
930 return; | 930 return; |
931 } | 931 } |
932 // Playback the buffer. | 932 // Playback the buffer. |
933 metafile->Playback(context, NULL); | 933 metafile->Playback(context, NULL); |
934 #else | 934 #else |
935 // TODO(port): plugin printing. | 935 // TODO(port): plugin printing. |
936 NOTIMPLEMENTED(); | 936 NOTIMPLEMENTED(); |
937 #endif | 937 #endif |
938 } | 938 } |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1420 } |
1421 #endif | 1421 #endif |
1422 | 1422 |
1423 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, | 1423 void WebPluginDelegateProxy::OnURLRedirectResponse(bool allow, |
1424 int resource_id) { | 1424 int resource_id) { |
1425 if (!plugin_) | 1425 if (!plugin_) |
1426 return; | 1426 return; |
1427 | 1427 |
1428 plugin_->URLRedirectResponse(allow, resource_id); | 1428 plugin_->URLRedirectResponse(allow, resource_id); |
1429 } | 1429 } |
OLD | NEW |