OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/glue/webkit_glue.h" | 5 #include "webkit/glue/webkit_glue.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <objidl.h> | 8 #include <objidl.h> |
9 #include <mlang.h> | 9 #include <mlang.h> |
10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 10 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 BuildUserAgentFromProduct("Version/5.0.4 Safari/533.20.27"); | 404 BuildUserAgentFromProduct("Version/5.0.4 Safari/533.20.27"); |
405 } | 405 } |
406 return mimic_mac_safari_user_agent_; | 406 return mimic_mac_safari_user_agent_; |
407 } | 407 } |
408 #endif | 408 #endif |
409 } | 409 } |
410 | 410 |
411 return user_agent_; | 411 return user_agent_; |
412 } | 412 } |
413 | 413 |
414 base::LazyInstance<UserAgentState> g_user_agent(base::LINKER_INITIALIZED); | 414 base::LazyInstance<UserAgentState> g_user_agent = LAZY_INSTANCE_INITIALIZER; |
415 | 415 |
416 } // namespace | 416 } // namespace |
417 | 417 |
418 void SetUserAgent(const std::string& user_agent, bool overriding) { | 418 void SetUserAgent(const std::string& user_agent, bool overriding) { |
419 g_user_agent.Get().Set(user_agent, overriding); | 419 g_user_agent.Get().Set(user_agent, overriding); |
420 } | 420 } |
421 | 421 |
422 const std::string& GetUserAgent(const GURL& url) { | 422 const std::string& GetUserAgent(const GURL& url) { |
423 return g_user_agent.Get().Get(url); | 423 return g_user_agent.Get().Get(url); |
424 } | 424 } |
(...skipping 24 matching lines...) Expand all Loading... |
449 std::string GetInspectorProtocolVersion() { | 449 std::string GetInspectorProtocolVersion() { |
450 return WebDevToolsAgent::inspectorProtocolVersion().utf8(); | 450 return WebDevToolsAgent::inspectorProtocolVersion().utf8(); |
451 } | 451 } |
452 | 452 |
453 bool IsInspectorProtocolVersionSupported(const std::string& version) { | 453 bool IsInspectorProtocolVersionSupported(const std::string& version) { |
454 return WebDevToolsAgent::supportsInspectorProtocolVersion( | 454 return WebDevToolsAgent::supportsInspectorProtocolVersion( |
455 WebString::fromUTF8(version)); | 455 WebString::fromUTF8(version)); |
456 } | 456 } |
457 | 457 |
458 } // namespace webkit_glue | 458 } // namespace webkit_glue |
OLD | NEW |