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

Side by Side Diff: chrome/plugin/chrome_plugin_host.cc

Issue 654013: Deprecate file_util::AppendToPath() on non-Windows. (Closed)
Patch Set: ok Created 10 years, 10 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
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | printing/printed_document.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | printing/printed_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698