From 288488c29bc8eabd5f2c34c0fd1b07fe7b006dd0 Mon Sep 17 00:00:00 2001 From: "thomasvl@chromium.org" Date: Wed, 30 Sep 2009 19:06:18 +0000 Subject: Page Info Window - Localize title - Localize button - Autosize button to text - Localize headings - Fetch the page info good/bad images from the resource bundle Stop including the page info good/bad images in the app bundle. TEST=Page Info dialog is localized and the button isn't clipped. BUG=20230 BUG=20536 Review URL: http://codereview.chromium.org/246048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27641 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/nibs/PageInfo.xib | 227 +++++++++++++++++---- .../browser/cocoa/page_info_window_controller.mm | 11 +- chrome/chrome.gyp | 3 +- 3 files changed, 190 insertions(+), 51 deletions(-) (limited to 'chrome') diff --git a/chrome/app/nibs/PageInfo.xib b/chrome/app/nibs/PageInfo.xib index dbf014a..a294a65 100644 --- a/chrome/app/nibs/PageInfo.xib +++ b/chrome/app/nibs/PageInfo.xib @@ -2,9 +2,9 @@ 1050 - 9J61 + 9L30 677 - 949.46 + 949.54 353.00 YES @@ -39,7 +39,7 @@ 2 {{196, 216}, {460, 290}} 536870912 - Page Information + ^IDS_PAGEINFO_WINDOW_TITLE NSWindow {3.40282e+38, 3.40282e+38} @@ -133,7 +133,7 @@ 67239424 0 - Identity + ^IDS_PAGE_INFO_SECURITY_TAB_IDENTITY_TITLE LucidaGrande 1.100000e+01 @@ -224,7 +224,7 @@ 67239424 0 - Connection + ^IDS_PAGE_INFO_SECURITY_TAB_CONNECTION_TITLE @@ -303,7 +303,7 @@ 67239424 0 - Visit History + ^IDS_PAGE_INFO_SECURITY_TAB_PERSONAL_HISTORY_TITLE @@ -317,29 +317,39 @@ 2 NO - + 292 - {{13, 12}, {227, 32}} - - YES - - 67239424 - 134217728 - View certificate information... - - LucidaGrande - 1.300000e+01 - 1044 + + YES + + + 292 + {{14, 12}, {126, 32}} + + YES + + 67239424 + 134217728 + ^IDS_PAGEINFO_CERT_INFO_BUTTON + + LucidaGrande + 1.300000e+01 + 1044 + + + -2038284033 + 129 + + + 200 + 25 + - - -2038284033 - 129 - - - 200 - 25 + {{-1, 0}, {154, 48}} + + GTMWidthBasedTweaker {460, 290} @@ -348,6 +358,12 @@ {{0, 0}, {1680, 1028}} {3.40282e+38, 3.40282e+38} + + GTMUILocalizerAndLayoutTweaker + + + ChromeUILocalizer + @@ -496,6 +512,22 @@ 57 + + + localizer_ + + + + 61 + + + + uiObject_ + + + + 62 + @@ -543,7 +575,7 @@ - + @@ -578,20 +610,6 @@ - 11 - - - YES - - - - - - 12 - - - - 20 @@ -675,6 +693,39 @@ + + 58 + + + YES + + + + + + 11 + + + YES + + + + + + 12 + + + + + 59 + + + + + 60 + + + @@ -706,7 +757,9 @@ 31.IBPluginDependency 32.IBPluginDependency 33.IBPluginDependency + 59.IBPluginDependency 6.IBPluginDependency + 60.IBPluginDependency 7.IBPluginDependency 8.IBPluginDependency @@ -740,6 +793,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -762,12 +817,93 @@ - 57 + 62 YES + ChromeUILocalizer + GTMUILocalizer + + IBProjectSource + browser/cocoa/ui_localizer.h + + + + GTMUILocalizer + NSObject + + YES + + YES + otherObjectToLocalize_ + owner_ + yetAnotherObjectToLocalize_ + + + YES + id + id + id + + + + IBProjectSource + ../third_party/GTM/AppKit/GTMUILocalizer.h + + + + GTMUILocalizerAndLayoutTweaker + NSObject + + YES + + YES + localizerOwner_ + localizer_ + uiObject_ + + + YES + id + GTMUILocalizer + id + + + + IBProjectSource + ../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h + + + + GTMWidthBasedTweaker + NSView + + YES + + YES + viewToResize_ + viewToSlideAndResize_ + viewToSlide_ + + + YES + id + NSView + NSView + + + + + + NSObject + + IBProjectSource + browser/cocoa/status_bubble_mac.h + + + NSObject IBProjectSource @@ -775,6 +911,13 @@ + NSWindow + + IBProjectSource + browser/cocoa/nswindow_local_state.h + + + PageInfoWindowController NSWindowController @@ -793,7 +936,7 @@ 0 - ../../../chrome.xcodeproj + ../../chrome.xcodeproj 3 diff --git a/chrome/browser/cocoa/page_info_window_controller.mm b/chrome/browser/cocoa/page_info_window_controller.mm index d8eb7c7..4fa8cb2 100644 --- a/chrome/browser/cocoa/page_info_window_controller.mm +++ b/chrome/browser/cocoa/page_info_window_controller.mm @@ -4,6 +4,7 @@ #import "chrome/browser/cocoa/page_info_window_controller.h" +#include "app/resource_bundle.h" #include "base/mac_util.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -31,13 +32,9 @@ NSString* nibpath = [bundle pathForResource:@"PageInfo" ofType:@"nib"]; if ((self = [super initWithWindowNibPath:nibpath owner:self])) { // Load the image refs. - NSImage* img = [[NSImage alloc] initByReferencingFile: - [bundle pathForResource:@"pageinfo_good" ofType:@"png"]]; - goodImg_.reset(img); - - img = [[NSImage alloc] initByReferencingFile: - [bundle pathForResource:@"pageinfo_bad" ofType:@"png"]]; - badImg_.reset(img); + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + goodImg_.reset([rb.GetNSImageNamed(IDR_PAGEINFO_GOOD) retain]); + badImg_.reset([rb.GetNSImageNamed(IDR_PAGEINFO_BAD) retain]); } return self; } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 464773a..c858864 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -2449,6 +2449,7 @@ 'app/nibs/ImportProgressDialog.xib', 'app/nibs/KeywordEditor.xib', 'app/nibs/MainMenu.xib', + 'app/nibs/PageInfo.xib', 'app/nibs/SaveAccessoryView.xib', 'app/nibs/TabView.xib', 'app/nibs/TaskManager.xib', @@ -3270,8 +3271,6 @@ 'app/theme/o2_search.png', 'app/theme/o2_star.png', 'app/theme/otr_icon.pdf', - 'app/theme/pageinfo_bad.png', - 'app/theme/pageinfo_good.png', 'app/theme/reload_Template.pdf', 'app/theme/star_Template.pdf', 'app/theme/starred.pdf', -- cgit v1.1