OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/plugin/chrome_plugin_host.h" | 5 #include "chrome/plugin/chrome_plugin_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 int STDCALL CPB_GetBrowsingContextInfo( | 415 int STDCALL CPB_GetBrowsingContextInfo( |
416 CPID id, CPBrowsingContext context, CPBrowsingContextInfoType type, | 416 CPID id, CPBrowsingContext context, CPBrowsingContextInfoType type, |
417 void* buf, uint32 buf_size) { | 417 void* buf, uint32 buf_size) { |
418 CHECK(ChromePluginLib::IsPluginThread()); | 418 CHECK(ChromePluginLib::IsPluginThread()); |
419 | 419 |
420 switch (type) { | 420 switch (type) { |
421 case CPBROWSINGCONTEXT_DATA_DIR_PTR: { | 421 case CPBROWSINGCONTEXT_DATA_DIR_PTR: { |
422 if (buf_size < sizeof(char*)) | 422 if (buf_size < sizeof(char*)) |
423 return sizeof(char*); | 423 return sizeof(char*); |
424 | 424 |
425 std::wstring wretval = CommandLine::ForCurrentProcess()-> | 425 FilePath path = CommandLine::ForCurrentProcess()-> |
426 GetSwitchValue(switches::kPluginDataDir); | 426 GetSwitchValuePath(switches::kPluginDataDir); |
427 DCHECK(!wretval.empty()); | 427 DCHECK(!path.empty()); |
428 file_util::AppendToPath(&wretval, chrome::kChromePluginDataDirname); | 428 std::string retval = WideToUTF8( |
429 *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); | 429 path.Append(chrome::kChromePluginDataDirname).ToWStringHack()); |
| 430 *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, retval); |
| 431 |
430 return CPERR_SUCCESS; | 432 return CPERR_SUCCESS; |
431 } | 433 } |
432 case CPBROWSINGCONTEXT_UI_LOCALE_PTR: { | 434 case CPBROWSINGCONTEXT_UI_LOCALE_PTR: { |
433 if (buf_size < sizeof(char*)) | 435 if (buf_size < sizeof(char*)) |
434 return sizeof(char*); | 436 return sizeof(char*); |
435 | 437 |
436 std::wstring wretval = webkit_glue::GetWebKitLocale(); | 438 std::wstring wretval = webkit_glue::GetWebKitLocale(); |
437 *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); | 439 *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); |
438 return CPERR_SUCCESS; | 440 return CPERR_SUCCESS; |
439 } | 441 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 | 710 |
709 response_funcs.size = sizeof(response_funcs); | 711 response_funcs.size = sizeof(response_funcs); |
710 response_funcs.received_redirect = CPRR_ReceivedRedirect; | 712 response_funcs.received_redirect = CPRR_ReceivedRedirect; |
711 response_funcs.start_completed = CPRR_StartCompleted; | 713 response_funcs.start_completed = CPRR_StartCompleted; |
712 response_funcs.read_completed = CPRR_ReadCompleted; | 714 response_funcs.read_completed = CPRR_ReadCompleted; |
713 response_funcs.upload_progress = CPRR_UploadProgress; | 715 response_funcs.upload_progress = CPRR_UploadProgress; |
714 } | 716 } |
715 | 717 |
716 return &browser_funcs; | 718 return &browser_funcs; |
717 } | 719 } |
OLD | NEW |