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

Side by Side Diff: ppapi/proxy/ppb_flash_proxy.cc

Issue 10681006: Add ppapi interface for setting crash data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/proxy/ppb_flash_proxy.h" 5 #include "ppapi/proxy/ppb_flash_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "googleurl/src/gurl.h"
10 #include "ppapi/c/dev/ppb_font_dev.h" 11 #include "ppapi/c/dev/ppb_font_dev.h"
11 #include "ppapi/c/dev/ppb_var_deprecated.h" 12 #include "ppapi/c/dev/ppb_var_deprecated.h"
12 #include "ppapi/c/pp_errors.h" 13 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/c/pp_resource.h" 14 #include "ppapi/c/pp_resource.h"
14 #include "ppapi/c/private/ppb_flash.h" 15 #include "ppapi/c/private/ppb_flash.h"
15 #include "ppapi/c/private/ppb_flash_print.h" 16 #include "ppapi/c/private/ppb_flash_print.h"
16 #include "ppapi/proxy/host_dispatcher.h" 17 #include "ppapi/proxy/host_dispatcher.h"
17 #include "ppapi/proxy/pepper_file_messages.h" 18 #include "ppapi/proxy/pepper_file_messages.h"
18 #include "ppapi/proxy/plugin_dispatcher.h" 19 #include "ppapi/proxy/plugin_dispatcher.h"
19 #include "ppapi/proxy/plugin_globals.h" 20 #include "ppapi/proxy/plugin_globals.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 plugin_dispatcher->preferences().is_stage3d_supported)); 301 plugin_dispatcher->preferences().is_stage3d_supported));
301 case PP_FLASHSETTING_LANGUAGE: 302 case PP_FLASHSETTING_LANGUAGE:
302 return StringVar::StringToPPVar( 303 return StringVar::StringToPPVar(
303 PluginGlobals::Get()->plugin_proxy_delegate()->GetUILanguage()); 304 PluginGlobals::Get()->plugin_proxy_delegate()->GetUILanguage());
304 case PP_FLASHSETTING_NUMCORES: 305 case PP_FLASHSETTING_NUMCORES:
305 return PP_MakeInt32(plugin_dispatcher->preferences().number_of_cpu_cores); 306 return PP_MakeInt32(plugin_dispatcher->preferences().number_of_cpu_cores);
306 } 307 }
307 return PP_MakeUndefined(); 308 return PP_MakeUndefined();
308 } 309 }
309 310
311 PP_Bool PPB_Flash_Proxy::SetCrashData(PP_Instance instance,
312 PP_FlashCrashKey key,
313 PP_Var value) {
314 switch (key) {
315 case PP_FLASHCRASHKEY_URL:
316 StringVar *url_string_var(StringVar::FromPPVar(value));
317 if (!url_string_var)
318 return PP_FALSE;
319 GURL gurl(url_string_var->value());
320 PluginGlobals::Get()->plugin_proxy_delegate()->SetActiveURL(gurl);
321 return PP_TRUE;
322 }
323 return PP_FALSE;
324 }
325
310 PP_Bool PPB_Flash_Proxy::IsClipboardFormatAvailable( 326 PP_Bool PPB_Flash_Proxy::IsClipboardFormatAvailable(
311 PP_Instance instance, 327 PP_Instance instance,
312 PP_Flash_Clipboard_Type clipboard_type, 328 PP_Flash_Clipboard_Type clipboard_type,
313 PP_Flash_Clipboard_Format format) { 329 PP_Flash_Clipboard_Format format) {
314 if (!IsValidClipboardType(clipboard_type) || !IsValidClipboardFormat(format)) 330 if (!IsValidClipboardType(clipboard_type) || !IsValidClipboardFormat(format))
315 return PP_FALSE; 331 return PP_FALSE;
316 332
317 bool result = false; 333 bool result = false;
318 dispatcher()->Send(new PpapiHostMsg_PPBFlash_IsClipboardFormatAvailable( 334 dispatcher()->Send(new PpapiHostMsg_PPBFlash_IsClipboardFormatAvailable(
319 API_ID_PPB_FLASH, 335 API_ID_PPB_FLASH,
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 // It's rarely used enough that we just request this interface when needed. 848 // It's rarely used enough that we just request this interface when needed.
833 const PPB_Flash_Print_1_0* print_interface = 849 const PPB_Flash_Print_1_0* print_interface =
834 static_cast<const PPB_Flash_Print_1_0*>( 850 static_cast<const PPB_Flash_Print_1_0*>(
835 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); 851 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0));
836 if (print_interface) 852 if (print_interface)
837 print_interface->InvokePrinting(instance); 853 print_interface->InvokePrinting(instance);
838 } 854 }
839 855
840 } // namespace proxy 856 } // namespace proxy
841 } // namespace ppapi 857 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698