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

Side by Side Diff: chrome/browser/ui/cocoa/about_window_controller.mm

Issue 9320056: Help: Implement the initial version of the cross-platform help/about page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: String fix. Created 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/about_window_controller.h" 5 #import "chrome/browser/ui/cocoa/about_window_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 // src/chrome/browser/ui/views/about_chrome_view.cc AboutChromeView::Init() 647 // src/chrome/browser/ui/views/about_chrome_view.cc AboutChromeView::Init()
648 648
649 NSMutableAttributedString* legal_block = 649 NSMutableAttributedString* legal_block =
650 [[[NSMutableAttributedString alloc] init] autorelease]; 650 [[[NSMutableAttributedString alloc] init] autorelease];
651 [legal_block beginEditing]; 651 [legal_block beginEditing];
652 652
653 NSString* copyright = 653 NSString* copyright =
654 l10n_util::GetNSStringWithFixup(IDS_ABOUT_VERSION_COPYRIGHT); 654 l10n_util::GetNSStringWithFixup(IDS_ABOUT_VERSION_COPYRIGHT);
655 AttributedStringAppendString(legal_block, copyright); 655 AttributedStringAppendString(legal_block, copyright);
656 656
657 // These are the markers directly in IDS_ABOUT_VERSION_LICENSE 657 // These are the markers directly in IDS_ABOUT_OLD_VERSION_LICENSE
658 NSString* kBeginLinkChr = @"BEGIN_LINK_CHR"; 658 NSString* kBeginLinkChr = @"BEGIN_LINK_CHR";
659 NSString* kBeginLinkOss = @"BEGIN_LINK_OSS"; 659 NSString* kBeginLinkOss = @"BEGIN_LINK_OSS";
660 NSString* kEndLinkChr = @"END_LINK_CHR"; 660 NSString* kEndLinkChr = @"END_LINK_CHR";
661 NSString* kEndLinkOss = @"END_LINK_OSS"; 661 NSString* kEndLinkOss = @"END_LINK_OSS";
662 // The CHR link should go to here 662 // The CHR link should go to here
663 GURL url = google_util::AppendGoogleLocaleParam( 663 GURL url = google_util::AppendGoogleLocaleParam(
664 GURL(chrome::kChromiumProjectURL)); 664 GURL(chrome::kChromiumProjectURL));
665 NSString* kChromiumProject = base::SysUTF8ToNSString(url.spec()); 665 NSString* kChromiumProject = base::SysUTF8ToNSString(url.spec());
666 // The OSS link should go to here 666 // The OSS link should go to here
667 NSString* kAcknowledgements = 667 NSString* kAcknowledgements =
668 [NSString stringWithUTF8String:chrome::kChromeUICreditsURL]; 668 [NSString stringWithUTF8String:chrome::kChromeUICreditsURL];
669 669
670 // Now fetch the license string and deal with the markers 670 // Now fetch the license string and deal with the markers
671 671
672 NSString* license = 672 NSString* license =
673 l10n_util::GetNSStringWithFixup(IDS_ABOUT_VERSION_LICENSE); 673 l10n_util::GetNSStringWithFixup(IDS_ABOUT_OLD_VERSION_LICENSE);
674 674
675 NSRange begin_chr = [license rangeOfString:kBeginLinkChr]; 675 NSRange begin_chr = [license rangeOfString:kBeginLinkChr];
676 NSRange begin_oss = [license rangeOfString:kBeginLinkOss]; 676 NSRange begin_oss = [license rangeOfString:kBeginLinkOss];
677 NSRange end_chr = [license rangeOfString:kEndLinkChr]; 677 NSRange end_chr = [license rangeOfString:kEndLinkChr];
678 NSRange end_oss = [license rangeOfString:kEndLinkOss]; 678 NSRange end_oss = [license rangeOfString:kEndLinkOss];
679 DCHECK_NE(begin_chr.location, NSNotFound); 679 DCHECK_NE(begin_chr.location, NSNotFound);
680 DCHECK_NE(begin_oss.location, NSNotFound); 680 DCHECK_NE(begin_oss.location, NSNotFound);
681 DCHECK_NE(end_chr.location, NSNotFound); 681 DCHECK_NE(end_chr.location, NSNotFound);
682 DCHECK_NE(end_oss.location, NSNotFound); 682 DCHECK_NE(end_oss.location, NSNotFound);
683 683
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 NSRange string_range = NSMakeRange(0, [legal_block length]); 754 NSRange string_range = NSMakeRange(0, [legal_block length]);
755 [legal_block addAttribute:NSFontAttributeName 755 [legal_block addAttribute:NSFontAttributeName
756 value:[NSFont labelFontOfSize:11] 756 value:[NSFont labelFontOfSize:11]
757 range:string_range]; 757 range:string_range];
758 758
759 [legal_block endEditing]; 759 [legal_block endEditing];
760 return legal_block; 760 return legal_block;
761 } 761 }
762 762
763 @end // @implementation AboutWindowController 763 @end // @implementation AboutWindowController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698