| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 | 7 |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <mlang.h> | 10 #include <mlang.h> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ScriptController.h" | 30 #include "ScriptController.h" |
| 31 #include "SharedBuffer.h" | 31 #include "SharedBuffer.h" |
| 32 MSVC_POP_WARNING(); | 32 MSVC_POP_WARNING(); |
| 33 | 33 |
| 34 #undef LOG | 34 #undef LOG |
| 35 #include "webkit/glue/webkit_glue.h" | 35 #include "webkit/glue/webkit_glue.h" |
| 36 | 36 |
| 37 #include "base/file_version_info.h" | 37 #include "base/file_version_info.h" |
| 38 #include "base/singleton.h" | 38 #include "base/singleton.h" |
| 39 #include "base/string_util.h" | 39 #include "base/string_util.h" |
| 40 #include "base/sys_info.h" |
| 40 #include "skia/include/SkBitmap.h" | 41 #include "skia/include/SkBitmap.h" |
| 41 #include "webkit/glue/event_conversion.h" | 42 #include "webkit/glue/event_conversion.h" |
| 42 #include "webkit/glue/glue_util.h" | 43 #include "webkit/glue/glue_util.h" |
| 43 #include "webkit/glue/weburlrequest_impl.h" | 44 #include "webkit/glue/weburlrequest_impl.h" |
| 44 #include "webkit/glue/webframe_impl.h" | 45 #include "webkit/glue/webframe_impl.h" |
| 45 #include "webkit/glue/webview_impl.h" | 46 #include "webkit/glue/webview_impl.h" |
| 46 | 47 |
| 47 //------------------------------------------------------------------------------ | 48 //------------------------------------------------------------------------------ |
| 48 // webkit_glue impl: | 49 // webkit_glue impl: |
| 49 | 50 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool user_agent_is_overridden; | 330 bool user_agent_is_overridden; |
| 330 }; | 331 }; |
| 331 | 332 |
| 332 Singleton<UserAgentState> g_user_agent; | 333 Singleton<UserAgentState> g_user_agent; |
| 333 | 334 |
| 334 void BuildUserAgent(bool mimic_safari, std::string* result) { | 335 void BuildUserAgent(bool mimic_safari, std::string* result) { |
| 335 #if defined(OS_WIN) || defined(OS_MACOSX) | 336 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 336 int32 os_major_version = 0; | 337 int32 os_major_version = 0; |
| 337 int32 os_minor_version = 0; | 338 int32 os_minor_version = 0; |
| 338 int32 os_bugfix_version = 0; | 339 int32 os_bugfix_version = 0; |
| 339 #if defined(OS_WIN) | 340 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
| 340 OSVERSIONINFO info = {0}; | 341 &os_minor_version, |
| 341 info.dwOSVersionInfoSize = sizeof(info); | 342 &os_bugfix_version); |
| 342 GetVersionEx(&info); | |
| 343 os_major_version = info.dwMajorVersion; | |
| 344 os_minor_version = info.dwMinorVersion; | |
| 345 #elif defined(OS_MACOSX) | |
| 346 Gestalt(gestaltSystemVersionMajor, | |
| 347 reinterpret_cast<SInt32*>(&os_major_version)); | |
| 348 Gestalt(gestaltSystemVersionMinor, | |
| 349 reinterpret_cast<SInt32*>(&os_minor_version)); | |
| 350 Gestalt(gestaltSystemVersionBugFix, | |
| 351 reinterpret_cast<SInt32*>(&os_bugfix_version)); | |
| 352 #endif | |
| 353 | 343 |
| 354 // Get the product name and version, and replace Safari's Version/X string | 344 // Get the product name and version, and replace Safari's Version/X string |
| 355 // with it. This is done to expose our product name in a manner that is | 345 // with it. This is done to expose our product name in a manner that is |
| 356 // maximally compatible with Safari, we hope!! | 346 // maximally compatible with Safari, we hope!! |
| 357 std::string product; | 347 std::string product; |
| 358 | 348 |
| 359 if (!mimic_safari) { | 349 if (!mimic_safari) { |
| 360 scoped_ptr<FileVersionInfo> version_info( | 350 scoped_ptr<FileVersionInfo> version_info( |
| 361 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 351 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 362 if (version_info.get()) | 352 if (version_info.get()) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 } | 445 } |
| 456 | 446 |
| 457 g_forcefully_terminate_plugin_process = value; | 447 g_forcefully_terminate_plugin_process = value; |
| 458 } | 448 } |
| 459 | 449 |
| 460 bool ShouldForcefullyTerminatePluginProcess() { | 450 bool ShouldForcefullyTerminatePluginProcess() { |
| 461 return g_forcefully_terminate_plugin_process; | 451 return g_forcefully_terminate_plugin_process; |
| 462 } | 452 } |
| 463 | 453 |
| 464 } // namespace webkit_glue | 454 } // namespace webkit_glue |
| OLD | NEW |