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

Side by Side Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 193072: Move StringPiece into the base namespace. It is colliding (Closed)
Patch Set: take 2 Created 11 years, 3 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
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <ApplicationServices/ApplicationServices.h> 5 #include <ApplicationServices/ApplicationServices.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 #import <objc/objc-runtime.h> 7 #import <objc/objc-runtime.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "webkit/tools/test_shell/test_shell.h" 10 #include "webkit/tools/test_shell/test_shell.h"
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 void TestShell::ShowStartupDebuggingDialog() { 602 void TestShell::ShowStartupDebuggingDialog() {
603 NSAlert* alert = [[[NSAlert alloc] init] autorelease]; 603 NSAlert* alert = [[[NSAlert alloc] init] autorelease];
604 alert.messageText = @"Attach to me?"; 604 alert.messageText = @"Attach to me?";
605 alert.informativeText = @"This would probably be a good time to attach your " 605 alert.informativeText = @"This would probably be a good time to attach your "
606 "debugger."; 606 "debugger.";
607 [alert addButtonWithTitle:@"OK"]; 607 [alert addButtonWithTitle:@"OK"];
608 608
609 [alert runModal]; 609 [alert runModal];
610 } 610 }
611 611
612 StringPiece TestShell::NetResourceProvider(int key) { 612 base::StringPiece TestShell::NetResourceProvider(int key) {
613 // TODO(port): Return the requested resource. 613 // TODO(port): Return the requested resource.
614 return StringPiece(); 614 return base::StringPiece();
615 } 615 }
616 616
617 //----------------------------------------------------------------------------- 617 //-----------------------------------------------------------------------------
618 618
619 namespace webkit_glue { 619 namespace webkit_glue {
620 620
621 string16 GetLocalizedString(int message_id) { 621 string16 GetLocalizedString(int message_id) {
622 StringPiece res; 622 base::StringPiece res;
623 if (!g_resource_data_pack->Get(message_id, &res)) { 623 if (!g_resource_data_pack->Get(message_id, &res)) {
624 LOG(FATAL) << "failed to load webkit string with id " << message_id; 624 LOG(FATAL) << "failed to load webkit string with id " << message_id;
625 } 625 }
626 626
627 return string16(reinterpret_cast<const char16*>(res.data()), 627 return string16(reinterpret_cast<const char16*>(res.data()),
628 res.length() / 2); 628 res.length() / 2);
629 } 629 }
630 630
631 StringPiece GetDataResource(int resource_id) { 631 base::StringPiece GetDataResource(int resource_id) {
632 switch (resource_id) { 632 switch (resource_id) {
633 case IDR_BROKENIMAGE: { 633 case IDR_BROKENIMAGE: {
634 // Use webkit's broken image icon (16x16) 634 // Use webkit's broken image icon (16x16)
635 static std::string broken_image_data; 635 static std::string broken_image_data;
636 if (broken_image_data.empty()) { 636 if (broken_image_data.empty()) {
637 FilePath path = GetResourcesFilePath(); 637 FilePath path = GetResourcesFilePath();
638 // In order to match WebKit's colors for the missing image, we have to 638 // In order to match WebKit's colors for the missing image, we have to
639 // use a PNG. The GIF doesn't have the color range needed to correctly 639 // use a PNG. The GIF doesn't have the color range needed to correctly
640 // match the TIFF they use in Safari. 640 // match the TIFF they use in Safari.
641 path = path.AppendASCII("missingImage.png"); 641 path = path.AppendASCII("missingImage.png");
(...skipping 29 matching lines...) Expand all
671 case IDR_SEARCH_CANCEL: 671 case IDR_SEARCH_CANCEL:
672 case IDR_SEARCH_CANCEL_PRESSED: 672 case IDR_SEARCH_CANCEL_PRESSED:
673 case IDR_SEARCH_MAGNIFIER: 673 case IDR_SEARCH_MAGNIFIER:
674 case IDR_SEARCH_MAGNIFIER_RESULTS: 674 case IDR_SEARCH_MAGNIFIER_RESULTS:
675 return TestShell::NetResourceProvider(resource_id); 675 return TestShell::NetResourceProvider(resource_id);
676 676
677 default: 677 default:
678 break; 678 break;
679 } 679 }
680 680
681 return StringPiece(); 681 return base::StringPiece();
682 } 682 }
683 683
684 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { 684 void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) {
685 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins); 685 NPAPI::PluginList::Singleton()->GetPlugins(refresh, plugins);
686 } 686 }
687 687
688 bool DownloadUrl(const std::string& url, NSWindow* caller_window) { 688 bool DownloadUrl(const std::string& url, NSWindow* caller_window) {
689 return false; 689 return false;
690 } 690 }
691 691
692 void DidLoadPlugin(const std::string& filename) { 692 void DidLoadPlugin(const std::string& filename) {
693 } 693 }
694 694
695 void DidUnloadPlugin(const std::string& filename) { 695 void DidUnloadPlugin(const std::string& filename) {
696 } 696 }
697 697
698 } // namespace webkit_glue 698 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/test_shell_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698