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

Side by Side Diff: Source/core/frame/NavigatorID.cpp

Issue 896463002: Remove the WEBCORE_NAVIGATOR_* defines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/Navigator.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 14 matching lines...) Expand all
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "core/frame/NavigatorID.h" 33 #include "core/frame/NavigatorID.h"
34 34
35 #if !defined(WEBCORE_NAVIGATOR_PLATFORM) && OS(POSIX) && !OS(MACOSX) 35 #if !OS(MACOSX) && !OS(WIN)
36 #include "wtf/Threading.h" 36 #include "wtf/Threading.h"
37 #include <sys/utsname.h> 37 #include <sys/utsname.h>
38 #endif 38 #endif
39 39
40 #ifndef WEBCORE_NAVIGATOR_PRODUCT
41 #define WEBCORE_NAVIGATOR_PRODUCT "Gecko"
42 #endif // ifndef WEBCORE_NAVIGATOR_PRODUCT
43
44 namespace blink { 40 namespace blink {
45 41
46 String NavigatorID::appCodeName() 42 String NavigatorID::appCodeName()
47 { 43 {
48 return "Mozilla"; 44 return "Mozilla";
49 } 45 }
50 46
51 String NavigatorID::appName() 47 String NavigatorID::appName()
52 { 48 {
53 return "Netscape"; 49 return "Netscape";
54 } 50 }
55 51
56 String NavigatorID::appVersion() 52 String NavigatorID::appVersion()
57 { 53 {
58 // Version is everything in the user agent string past the "Mozilla/" prefix . 54 // Version is everything in the user agent string past the "Mozilla/" prefix .
59 const String& agent = userAgent(); 55 const String& agent = userAgent();
60 return agent.substring(agent.find('/') + 1); 56 return agent.substring(agent.find('/') + 1);
61 } 57 }
62 58
63 String NavigatorID::platform() 59 String NavigatorID::platform()
64 { 60 {
65 #if defined(WEBCORE_NAVIGATOR_PLATFORM) 61 #if OS(MACOSX)
66 return WEBCORE_NAVIGATOR_PLATFORM;
67 #elif OS(MACOSX)
68 // Match Safari and Mozilla on Mac x86. 62 // Match Safari and Mozilla on Mac x86.
69 return "MacIntel"; 63 return "MacIntel";
70 #elif OS(WIN) 64 #elif OS(WIN)
71 // Match Safari and Mozilla on Windows. 65 // Match Safari and Mozilla on Windows.
72 return "Win32"; 66 return "Win32";
73 #else // Unix-like systems 67 #else // Unix-like systems
74 struct utsname osname; 68 struct utsname osname;
75 AtomicallyInitializedStaticReference(String, platformName, new String(uname( &osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : emptyString())); 69 AtomicallyInitializedStaticReference(String, platformName, new String(uname( &osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : emptyString()));
76 return platformName; 70 return platformName;
77 #endif 71 #endif
78 } 72 }
79 73
80 String NavigatorID::product() 74 String NavigatorID::product()
81 { 75 {
82 return WEBCORE_NAVIGATOR_PRODUCT; 76 return "Gecko";
83 } 77 }
84 78
85 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/Navigator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698