Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginSystem.cpp

Issue 5750789393874944: [IE] First round of ATL removal (Closed)
Patch Set: Created June 20, 2014, 9:22 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 // Internet / FTP 3 // Internet / FTP
4 #include <wininet.h> 4 #include <wininet.h>
5 5
6 // IP adapter 6 // IP adapter
7 #include <iphlpapi.h> 7 #include <iphlpapi.h>
8 8
9 #include "PluginSystem.h" 9 #include "PluginSystem.h"
10 #include "PluginClient.h" 10 #include "PluginClient.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 s_instance = systemInstance; 51 s_instance = systemInstance;
52 } 52 }
53 53
54 system = s_instance; 54 system = s_instance;
55 } 55 }
56 s_criticalSection.Unlock(); 56 s_criticalSection.Unlock();
57 57
58 return system; 58 return system;
59 } 59 }
60 60
61 CString CPluginSystem::GetBrowserLanguage() const 61 std::wstring CPluginSystem::GetBrowserLanguage() const
62 { 62 {
63 LANGID lcid = ::GetUserDefaultLangID(); 63 LANGID lcid = ::GetUserDefaultLangID();
64 TCHAR language[128]; 64 wchar_t language[128];
65 memset(language, 0, sizeof(language)); 65 memset(language, 0, sizeof(language));
66 66
67 TCHAR country[128]; 67 wchar_t country[128];
68 memset(language, 0, sizeof(country)); 68 memset(language, 0, sizeof(country));
69 69
70 CString lang; 70 std::wstring lang;
71 71
72 int res = ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, language, 127); 72 int res = ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, language, 127);
73 if (res == 0) 73 if (res == 0)
74 { 74 {
75 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - Failed"); 75 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, L"System::GetBrowserLang - Failed");
76 } 76 }
77 else 77 else
78 { 78 {
79 lang.Append(language); 79 lang +=language ;
80 } 80 }
81 81 lang += L"-";
82 lang.Append(L"-");
83
84 82
85 res = ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, country, 127); 83 res = ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, country, 127);
86 if (res == 0) 84 if (res == 0)
87 { 85 {
88 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, "System::GetBrowserLang - failed to retrieve country"); 86 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_SYSINFO, PLUGIN_ERROR_SYSINFO _BROWSER_LANGUAGE, L"System::GetBrowserLang - failed to retrieve country");
89 } 87 }
90 else 88 else
91 { 89 {
92 lang.Append(country); 90 lang += country;
93 } 91 }
94
95 return lang; 92 return lang;
96 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld