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

Side by Side Diff: webkit/glue/webkit_glue.cc

Issue 519030: bsds: views/ and webkit/ support for FreeBSD/OpenBSD (Closed)
Patch Set: Created 10 years, 11 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 "config.h" 5 #include "config.h"
6 #include "webkit/glue/webkit_glue.h" 6 #include "webkit/glue/webkit_glue.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>
11 #elif defined(OS_LINUX) || defined(OS_FREEBSD) 11 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
12 #include <sys/utsname.h> 12 #include <sys/utsname.h>
13 #endif 13 #endif
14 14
15 #include "BackForwardList.h" 15 #include "BackForwardList.h"
16 #include "Document.h" 16 #include "Document.h"
17 #include "FrameTree.h" 17 #include "FrameTree.h"
18 #include "FrameView.h" 18 #include "FrameView.h"
19 #include "Frame.h" 19 #include "Frame.h"
20 #include "GlyphPageTreeNode.h" 20 #include "GlyphPageTreeNode.h"
21 #include "HistoryItem.h" 21 #include "HistoryItem.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 std::string os_cpu; 361 std::string os_cpu;
362 362
363 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) 363 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
364 int32 os_major_version = 0; 364 int32 os_major_version = 0;
365 int32 os_minor_version = 0; 365 int32 os_minor_version = 0;
366 int32 os_bugfix_version = 0; 366 int32 os_bugfix_version = 0;
367 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, 367 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
368 &os_minor_version, 368 &os_minor_version,
369 &os_bugfix_version); 369 &os_bugfix_version);
370 #endif 370 #endif
371 #if !defined(OS_WIN) && !defined(OS_MACOSX) 371 #if defined(OS_POSIX) && !defined(OS_MACOSX)
372 // Should work on any Posix system. 372 // Should work on any Posix system.
373 struct utsname unixinfo; 373 struct utsname unixinfo;
374 uname(&unixinfo); 374 uname(&unixinfo);
375 375
376 std::string cputype; 376 std::string cputype;
377 // special case for biarch systems 377 // special case for biarch systems
378 if (strcmp(unixinfo.machine, "x86_64") == 0 && 378 if (strcmp(unixinfo.machine, "x86_64") == 0 &&
379 sizeof(void*) == sizeof(int32)) { 379 sizeof(void*) == sizeof(int32)) {
380 cputype.assign("i686 (x86_64)"); 380 cputype.assign("i686 (x86_64)");
381 } else { 381 } else {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // The other parameters are workarounds for broken websites: 414 // The other parameters are workarounds for broken websites:
415 // - If mimic_chrome1 is true, produce a fake Chrome 1 string. 415 // - If mimic_chrome1 is true, produce a fake Chrome 1 string.
416 // - If mimic_windows is true, produce a fake Windows Chrome string. 416 // - If mimic_windows is true, produce a fake Windows Chrome string.
417 void BuildUserAgent(bool mimic_chrome1, bool mimic_windows, 417 void BuildUserAgent(bool mimic_chrome1, bool mimic_windows,
418 std::string* result) { 418 std::string* result) {
419 const char kUserAgentPlatform[] = 419 const char kUserAgentPlatform[] =
420 #if defined(OS_WIN) 420 #if defined(OS_WIN)
421 "Windows"; 421 "Windows";
422 #elif defined(OS_MACOSX) 422 #elif defined(OS_MACOSX)
423 "Macintosh"; 423 "Macintosh";
424 #elif defined(OS_LINUX) 424 #elif defined(USE_X11)
425 "X11"; // strange, but that's what Firefox uses 425 "X11"; // strange, but that's what Firefox uses
426 #else 426 #else
427 "?"; 427 "?";
428 #endif 428 #endif
429 429
430 const char kUserAgentSecurity = 'U'; // "US" strength encryption 430 const char kUserAgentSecurity = 'U'; // "US" strength encryption
431 431
432 // TODO(port): figure out correct locale 432 // TODO(port): figure out correct locale
433 const char kUserAgentLocale[] = "en-US"; 433 const char kUserAgentLocale[] = "en-US";
434 434
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 if (MatchPatternASCII(url.host(), "*.pointroll.com")) { 492 if (MatchPatternASCII(url.host(), "*.pointroll.com")) {
493 // For cnn.com, which uses pointroll.com to serve their front door promo, 493 // For cnn.com, which uses pointroll.com to serve their front door promo,
494 // we must spoof Chrome 1.0 in order to avoid a blank page. 494 // we must spoof Chrome 1.0 in order to avoid a blank page.
495 // http://crbug.com/25934 495 // http://crbug.com/25934
496 // TODO(dglazkov): Remove this once CNN's front door promo is 496 // TODO(dglazkov): Remove this once CNN's front door promo is
497 // over or when pointroll fixes their sniffing. 497 // over or when pointroll fixes their sniffing.
498 if (g_user_agent->mimic_chrome1_user_agent.empty()) 498 if (g_user_agent->mimic_chrome1_user_agent.empty())
499 BuildUserAgent(true, false, &g_user_agent->mimic_chrome1_user_agent); 499 BuildUserAgent(true, false, &g_user_agent->mimic_chrome1_user_agent);
500 return g_user_agent->mimic_chrome1_user_agent; 500 return g_user_agent->mimic_chrome1_user_agent;
501 } 501 }
502 #if defined(OS_LINUX) 502 #if defined(OS_POSIX) && !defined(OS_MACOSX)
503 else if (MatchPatternASCII(url.host(), "*.mail.yahoo.com")) { 503 else if (MatchPatternASCII(url.host(), "*.mail.yahoo.com")) {
504 // mail.yahoo.com is ok with Windows Chrome but not Linux Chrome. 504 // mail.yahoo.com is ok with Windows Chrome but not Linux Chrome.
505 // http://bugs.chromium.org/11136 505 // http://bugs.chromium.org/11136
506 // TODO(evanm): remove this if Yahoo fixes their sniffing. 506 // TODO(evanm): remove this if Yahoo fixes their sniffing.
507 if (g_user_agent->mimic_windows_user_agent.empty()) 507 if (g_user_agent->mimic_windows_user_agent.empty())
508 BuildUserAgent(false, true, &g_user_agent->mimic_windows_user_agent); 508 BuildUserAgent(false, true, &g_user_agent->mimic_windows_user_agent);
509 return g_user_agent->mimic_windows_user_agent; 509 return g_user_agent->mimic_windows_user_agent;
510 } 510 }
511 #endif 511 #endif
512 } 512 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 bool IsMediaCacheEnabled() { 546 bool IsMediaCacheEnabled() {
547 return g_enable_media_cache; 547 return g_enable_media_cache;
548 } 548 }
549 549
550 void SetMediaCacheEnabled(bool enabled) { 550 void SetMediaCacheEnabled(bool enabled) {
551 g_enable_media_cache = enabled; 551 g_enable_media_cache = enabled;
552 } 552 }
553 553
554 } // namespace webkit_glue 554 } // namespace webkit_glue
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698