diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 16:12:52 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-10 16:12:52 +0000 |
commit | 51b95502776e23711259722219e3afde9318ee4a (patch) | |
tree | da95ed315592990457fd4ef2bb4f52ff1ce6a489 | |
parent | 994eeb0d32e289c0929bb2d52cd8defcb78f7b95 (diff) | |
download | chromium_src-51b95502776e23711259722219e3afde9318ee4a.zip chromium_src-51b95502776e23711259722219e3afde9318ee4a.tar.gz chromium_src-51b95502776e23711259722219e3afde9318ee4a.tar.bz2 |
First round of audits to make sure 'app' is displayed instead of 'extension' where appropriate. This includes some cleanup and deletion of stale/unused code surrounding apps and extensions.
BUG=61259
TEST=Make sure proper wording is used when dealing with apps instead of extensions.
Review URL: http://codereview.chromium.org/4753001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65663 0039d316-1c4b-4281-b951-d872f2087c98
10 files changed, 252 insertions, 230 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index c8cd6ee..940e6d2 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3545,99 +3545,67 @@ each locale. --> Undo </message> - <!-- Extension disabled info bar --> + <!-- Extension/App disabled info bar --> <message name="IDS_EXTENSION_DISABLED_INFOBAR_LABEL" desc="Text displayed on an infobar when an extension was disabled due to a new upgrade requiring an explicit permission check from the user."> The newest version of the extension "<ph name="EXTENSION_NAME">$1<ex>Flashblock</ex></ph>" requires more permissions, so it has been disabled. </message> - <message name="IDS_EXTENSION_DISABLED_INFOBAR_ENABLE_BUTTON" desc="Text displayed on the button to re-enable the disabled extension."> - Re-enable + <message name="IDS_APP_DISABLED_INFOBAR_LABEL" desc="Text displayed on an infobar when an app was disabled due to a new upgrade requiring an explicit permission check from the user."> + The newest version of the app "<ph name="APP_NAME">$1<ex>Pandora</ex></ph>" requires more permissions, so it has been disabled. </message> - - <!-- Extension incognito install failure info bar --> - <message name="IDS_EXTENSION_INCOGNITO_INSTALL_INFOBAR_LABEL" desc="Text displayed on an infobar when the user attempts to install an extension in incognito mode."> - Extension install failed: extensions are not supported in incognito windows. + <message name="IDS_EXTENSION_DISABLED_INFOBAR_ENABLE_BUTTON" desc="Text displayed on the button to re-enable the disabled extension or app."> + Re-enable </message> - <!-- Extension install prompt --> - <message name="IDS_EXTENSION_INSTALL_PROMPT_TITLE" desc="Titlebar of the extension installation prompt window"> + <!-- Extension/App install prompt --> + <message name="IDS_EXTENSION_INSTALL_PROMPT_TITLE" desc="Titlebar of the extension or app installation prompt window"> Confirm Installation </message> - <message name="IDS_EXTENSION_UNINSTALL_PROMPT_TITLE" desc="Titlebar of the extension uninstallation prompt window"> + <message name="IDS_EXTENSION_UNINSTALL_PROMPT_TITLE" desc="Titlebar of the extension or app uninstallation prompt window"> Confirm Uninstallation </message> - <message name="IDS_EXTENSION_INSTALL_PROMPT_HEADING" desc="First bold line in the content area of the extension installation prompt. Asks the user if they want to install a particular extension."> + <message name="IDS_EXTENSION_INSTALL_PROMPT_HEADING" desc="First bold line in the content area of the extension or app installation prompt. Asks the user if they want to install a particular extension or app."> Install <ph name="EXTENSION_NAME">$1<ex>Gmail Checker</ex></ph>? </message> - <message name="IDS_EXTENSION_PROMPT_CREATE_SHORTCUT" desc="Label for checkbox that asks the user if they want to create a desktop shortcut for an app install."> - Create desktop shortcut - </message> - <message name="IDS_EXTENSION_UNINSTALL_PROMPT_HEADING" desc="First bold line in the content area of the extension uninstallation prompt. Asks the user if they want to uninstall a particular extension."> + <message name="IDS_EXTENSION_UNINSTALL_PROMPT_HEADING" desc="First bold line in the content area of the extension or app uninstallation prompt. Asks the user if they want to uninstall a particular extension or app."> Uninstall "<ph name="EXTENSION_NAME">$1<ex>Gmail Checker</ex></ph>"? </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_BROWSER" desc="Warning displayed in body of extension dialog when the extension requires access to browser APIs."> - This extension will have access to your browsing history. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_SINGLE_HOST" desc="Warning displayed in body of extension dialog when the extension requires access to a single host."> - This extension will have access to your private data on <ph name="HOST">$1<ex>maps.google.com</ex></ph>. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_SINGLE_HOST_AND_BROWSER" desc="Warning displayed in body of extension dialog when the extension requires access to a single host and browser APIs."> - This extension will have access to your browsing history and private data on <ph name="HOST">$1<ex>maps.google.com</ex></ph>. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_MULTIPLE_HOSTS" desc="Warning displayed in body of extension dialog when the extension requires access to multiple hosts, but not every host."> - This extension will have access to your private data on multiple websites. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_MULTIPLE_HOSTS_AND_BROWSER" desc="Warning displayed in body of extension dialog when the extension requires access to multiple hosts, but not every host, and browser APIs."> - This extension will have access to your browsing history and private data on multiple websites. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS" desc="Warning displayed in body of extension dialog when the extension requires access to all hosts."> - This extension will have access to your private data on all websites. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS_AND_BROWSER" desc="Warning displayed in body of extension dialog when the extension requires access to all hosts and browser APIs."> - This extension will have access to your browsing history and private data on all websites. - </message> - <message name="IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS" desc="Warning displayed in body of extension dialog when the extension requires access the local machine."> - This extension will have full access to your computer and private data. - </message> - <!-- v2 extension install dialog strings --> - <message name="IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO" desc="Second line in the content area of the extension installation prompt. Note that the exact wording is important. This should mean that the extension _can_ access the listed privileges, but not necessarily that it will or needs to."> - This extension can access: - </message> - <message name="IDS_EXTENSION_PROMPT2_APP_WILL_HAVE_ACCESS_TO" desc="The same as IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO, but replace 'extension' with 'app'"> - This app can access: + <!-- Extension/App install dialog strings --> + <message name="IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO" desc="Second line in the content area of the extension or app installation prompt. Note that the exact wording is important. This should mean that the extension or app _can_ access the listed privileges, but not necessarily that it will or needs to."> + It can access: </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_FULL_ACCESS" desc="Permission string for full access to the computer and all websites."> + <message name="IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS" desc="Permission string for full access to the computer and all websites."> All data on your computer and the websites you visit </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_ALL_HOSTS" desc="Permission string for access to data on all websites."> + <message name="IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS" desc="Permission string for access to data on all websites."> Your data on all websites </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_1_HOST" desc="Permission string for access to data on one website."> + <message name="IDS_EXTENSION_PROMPT_WARNING_1_HOST" desc="Permission string for access to data on one website."> Your data on <ph name="WEBSITE_1">$1<ex>www.google.com</ex></ph> </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_2_HOSTS" desc="Permission string for access to data on two websites."> + <message name="IDS_EXTENSION_PROMPT_WARNING_2_HOSTS" desc="Permission string for access to data on two websites."> Your data on <ph name="WEBSITE_1">$1<ex>www.google.com</ex></ph> and <ph name="WEBSITE_2">$2<ex>www.reddit.com</ex></ph> </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_3_HOSTS" desc="Permission string for access to data on three websites."> + <message name="IDS_EXTENSION_PROMPT_WARNING_3_HOSTS" desc="Permission string for access to data on three websites."> Your data on <ph name="WEBSITE_1">$1<ex>www.google.com</ex></ph>, <ph name="WEBSITE_2">$2<ex>www.reddit.com</ex></ph>, and <ph name="WEBSITE_3">$3<ex>news.ycombinator.com</ex></ph> </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_4_OR_MORE_HOSTS" desc="Permission string for access to data on four or more websites."> + <message name="IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS" desc="Permission string for access to data on four or more websites."> Your data on <ph name="WEBSITE_1">$1<ex>www.google.com</ex></ph>, <ph name="WEBSITE_2">$2<ex>www.yahoo.com</ex></ph>, and <ph name="NUMBER_OF_OTHER_WEBSITES">$3<ex>3</ex></ph> other websites </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_BOOKMARKS" desc="Permission string for access to bookmarks."> + <message name="IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS" desc="Permission string for access to bookmarks."> Your bookmarks </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY" desc="Permission string for access to browsing history."> + <message name="IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY" desc="Permission string for access to browsing history."> Your browsing history </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_GEOLOCATION" desc="Permisson string for access to geolocation."> + <message name="IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION" desc="Permisson string for access to geolocation."> Your physical location </message> - <message name="IDS_EXTENSION_PROMPT2_WARNING_MANAGEMENT" desc="Permisson string for access to extension management."> + <message name="IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT" desc="Permisson string for access to extension management."> Manage themes, extensions, and apps </message> - <!-- Extension error messages --> + <!-- Extension/App error messages --> <message name="IDS_EXTENSION_DIRECTORY_NO_EXISTS" desc="Warning displayed in pack dialog when the extension directory does not exist."> Input directory must exist. </message> @@ -3741,9 +3709,6 @@ each locale. --> <message name="IDS_MANAGE_EXTENSIONS" desc="The 'Manage Extensions...' text in the context menu for when right-clicking on extension icons"> Manage extensions... </message> - <message name="IDS_EXTENSION_APP_INSTALLED_MANAGE_INFO" desc="Text displayed in the InfoBubble when an extension app is installed, with instructions on how to manage them"> - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque feugiat, magna quis vestibulum malesuada, lazy euros facilitatus nibbles, you faucibus purus lacus ac dolor! - </message> <message name="IDS_EXTENSION_INSTALLED_MANAGE_INFO" desc="Text displayed in the InfoBubble with instructions on how to find the chrome://extensions/ management page"> You can manage your installed extensions by clicking Extensions in the Tools menu. </message> diff --git a/chrome/app/nibs/ExtensionInstallPrompt.xib b/chrome/app/nibs/ExtensionInstallPrompt.xib index fa8da25..302c4d7 100644 --- a/chrome/app/nibs/ExtensionInstallPrompt.xib +++ b/chrome/app/nibs/ExtensionInstallPrompt.xib @@ -2,17 +2,17 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">10B504</string> - <string key="IBDocument.InterfaceBuilderVersion">732</string> - <string key="IBDocument.AppKitVersion">1038.2</string> - <string key="IBDocument.HIToolboxVersion">437.00</string> + <string key="IBDocument.SystemVersion">10F569</string> + <string key="IBDocument.InterfaceBuilderVersion">788</string> + <string key="IBDocument.AppKitVersion">1038.29</string> + <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> - <string key="NS.object.0">732</string> + <string key="NS.object.0">788</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="111"/> + <integer value="112"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -97,7 +97,7 @@ <object class="NSTextFieldCell" key="NSCell" id="545033131"> <int key="NSCellFlags">67239424</int> <int key="NSCellFlags2">272760832</int> - <string key="NSContents">^IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO</string> + <string key="NSContents">^IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO</string> <object class="NSFont" key="NSSupport" id="26"> <string key="NSName">LucidaGrande</string> <double key="NSSize">11</double> @@ -568,9 +568,9 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <bool key="EncodedWithXMLCoder">YES</bool> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{1102, 837}, {387, 167}}</string> + <string>{{381, 506}, {387, 167}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{1102, 837}, {387, 167}}</string> + <string>{{381, 506}, {387, 167}}</string> <boolean value="NO"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -633,6 +633,25 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string>id</string> </object> </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>cancel:</string> + <string>ok:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">cancel:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">ok:</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> @@ -656,6 +675,50 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string>NSTextField</string> </object> </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>cancelButton_</string> + <string>iconView_</string> + <string>okButton_</string> + <string>subtitleField_</string> + <string>titleField_</string> + <string>warningsBox_</string> + <string>warningsField_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">cancelButton_</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">iconView_</string> + <string key="candidateClassName">NSImageView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">okButton_</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">subtitleField_</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">titleField_</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">warningsBox_</string> + <string key="candidateClassName">NSBox</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">warningsField_</string> + <string key="candidateClassName">NSTextField</string> + </object> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/cocoa/extensions/extension_install_prompt_controller.h</string> @@ -679,6 +742,30 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string>id</string> </object> </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>otherObjectToLocalize_</string> + <string>owner_</string> + <string>yetAnotherObjectToLocalize_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">otherObjectToLocalize_</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">owner_</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">yetAnotherObjectToLocalize_</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizer.h</string> @@ -702,6 +789,30 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string>id</string> </object> </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>localizerOwner_</string> + <string>localizer_</string> + <string>uiObject_</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">localizerOwner_</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">localizer_</string> + <string key="candidateClassName">GTMUILocalizer</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">uiObject_</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">../third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h</string> @@ -718,6 +829,13 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string key="className">NSObject</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/objc_zombie.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSObject</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> <string key="minorKey">browser/cocoa/status_bubble_mac.h</string> </object> </object> @@ -729,10 +847,24 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> </object> </object> <object class="IBPartialClassDescription"> + <string key="className">NSView</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/view_id_util.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> + <string key="className">NSWindow</string> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">browser/cocoa/framed_browser_window.h</string> + </object> + </object> + <object class="IBPartialClassDescription"> <string key="className">NSWindow</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> - <string key="minorKey">browser/cocoa/chrome_browser_window.h</string> + <string key="minorKey">browser/cocoa/nswindow_additions.h</string> </object> </object> <object class="IBPartialClassDescription"> @@ -1437,6 +1569,13 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> <string key="NS.key.0">showWindow:</string> <string key="NS.object.0">id</string> </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">showWindow:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">showWindow:</string> + <string key="candidateClassName">id</string> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string> @@ -1445,6 +1584,7 @@ ARcABAAAAAEAAAACARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes> </object> </object> <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1050" key="NS.object.0"/> diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 193ccaa..a0d774a 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -230,52 +230,35 @@ void OpenChromeExtension(Profile* profile, DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(download_item.is_extension_install()); - // We don't support extensions in OTR mode. ExtensionsService* service = profile->GetExtensionsService(); - if (service) { - NotificationService* nservice = NotificationService::current(); - GURL nonconst_download_url = download_item.url(); - nservice->Notify(NotificationType::EXTENSION_READY_FOR_INSTALL, - Source<DownloadManager>(download_manager), - Details<GURL>(&nonconst_download_url)); - - scoped_refptr<CrxInstaller> installer( - new CrxInstaller(service->install_directory(), - service, - new ExtensionInstallUI(profile))); - installer->set_delete_source(true); - - if (UserScript::HasUserScriptFileExtension(download_item.url())) { - installer->InstallUserScript(download_item.full_path(), - download_item.url()); - } else { - bool is_gallery_download = service->IsDownloadFromGallery( - download_item.url(), download_item.referrer_url()); - installer->set_original_mime_type(download_item.original_mime_type()); - installer->set_apps_require_extension_mime_type(true); - installer->set_allow_privilege_increase(true); - installer->set_original_url(download_item.url()); - installer->set_is_gallery_install(is_gallery_download); - installer->InstallCrx(download_item.full_path()); - installer->set_allow_silent_install(is_gallery_download); - } - } else { - TabContents* contents = NULL; - // Get last active normal browser of profile. - Browser* last_active = - BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL, true); - if (last_active) - contents = last_active->GetSelectedTabContents(); - if (contents) { - contents->AddInfoBar( - new SimpleAlertInfoBarDelegate(contents, - l10n_util::GetStringUTF16( - IDS_EXTENSION_INCOGNITO_INSTALL_INFOBAR_LABEL), - ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_INFOBAR_PLUGIN_INSTALL), - true)); - } + CHECK(service); + NotificationService* nservice = NotificationService::current(); + GURL nonconst_download_url = download_item.url(); + nservice->Notify(NotificationType::EXTENSION_READY_FOR_INSTALL, + Source<DownloadManager>(download_manager), + Details<GURL>(&nonconst_download_url)); + + scoped_refptr<CrxInstaller> installer( + new CrxInstaller(service->install_directory(), + service, + new ExtensionInstallUI(profile))); + installer->set_delete_source(true); + + if (UserScript::HasUserScriptFileExtension(download_item.url())) { + installer->InstallUserScript(download_item.full_path(), + download_item.url()); + return; } + + bool is_gallery_download = service->IsDownloadFromGallery( + download_item.url(), download_item.referrer_url()); + installer->set_original_mime_type(download_item.original_mime_type()); + installer->set_apps_require_extension_mime_type(true); + installer->set_allow_privilege_increase(true); + installer->set_original_url(download_item.url()); + installer->set_is_gallery_install(is_gallery_download); + installer->InstallCrx(download_item.full_path()); + installer->set_allow_silent_install(is_gallery_download); } // Download progress painting -------------------------------------------------- @@ -724,26 +707,26 @@ int GetUniquePathNumberWithCrDownload(const FilePath& path) { } namespace { -
-// NOTE: If index is 0, deletes files that do not have the " (nnn)" appended.
-void DeleteUniqueDownloadFile(const FilePath& path, int index) {
- FilePath new_path(path);
- if (index > 0)
- AppendNumberToPath(&new_path, index);
- file_util::Delete(new_path, false);
-}
-
-}
-
-void EraseUniqueDownloadFiles(const FilePath& path) {
- FilePath cr_path = GetCrDownloadPath(path);
-
- for (int index = 0; index <= kMaxUniqueFiles; ++index) {
- DeleteUniqueDownloadFile(path, index);
- DeleteUniqueDownloadFile(cr_path, index);
- }
-}
-
+ +// NOTE: If index is 0, deletes files that do not have the " (nnn)" appended. +void DeleteUniqueDownloadFile(const FilePath& path, int index) { + FilePath new_path(path); + if (index > 0) + AppendNumberToPath(&new_path, index); + file_util::Delete(new_path, false); +} + +} + +void EraseUniqueDownloadFiles(const FilePath& path) { + FilePath cr_path = GetCrDownloadPath(path); + + for (int index = 0; index <= kMaxUniqueFiles; ++index) { + DeleteUniqueDownloadFile(path, index); + DeleteUniqueDownloadFile(cr_path, index); + } +} + FilePath GetCrDownloadPath(const FilePath& suggested_path) { FilePath::StringType file_name; base::SStringPrintf( @@ -771,3 +754,4 @@ bool IsDangerous(DownloadCreateInfo* info, Profile* profile) { } } // namespace download_util + diff --git a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc index af38e4f..d66a448 100644 --- a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc +++ b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc @@ -78,8 +78,9 @@ class ExtensionDisabledInfobarDelegate virtual ~ExtensionDisabledInfobarDelegate() { } virtual string16 GetMessageText() const { - return l10n_util::GetStringFUTF16(IDS_EXTENSION_DISABLED_INFOBAR_LABEL, - UTF8ToUTF16(extension_->name())); + return l10n_util::GetStringFUTF16(extension_->is_app() ? + IDS_APP_DISABLED_INFOBAR_LABEL : IDS_EXTENSION_DISABLED_INFOBAR_LABEL, + UTF8ToUTF16(extension_->name())); } virtual SkBitmap* GetIcon() const { return NULL; diff --git a/chrome/browser/gtk/extension_install_prompt2_gtk.cc b/chrome/browser/gtk/extension_install_prompt2_gtk.cc index cf78028..10ee4e4 100644 --- a/chrome/browser/gtk/extension_install_prompt2_gtk.cc +++ b/chrome/browser/gtk/extension_install_prompt2_gtk.cc @@ -107,11 +107,8 @@ void ShowInstallPromptDialog2(GtkWindow* parent, SkBitmap* skia_icon, !show_permissions, !show_permissions, 0); if (show_permissions) { - int label = extension->is_app() ? - IDS_EXTENSION_PROMPT2_APP_WILL_HAVE_ACCESS_TO : - IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO; GtkWidget* warning_label = gtk_label_new(l10n_util::GetStringUTF8( - label).c_str()); + IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO).c_str()); gtk_misc_set_alignment(GTK_MISC(warning_label), 0.0, 0.5); gtk_util::SetLabelWidth(warning_label, kRightColumnMinWidth); diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt.cc b/chrome/browser/ui/views/extensions/extension_install_prompt.cc index 5cf1e7b..1e1ea37 100644 --- a/chrome/browser/ui/views/extensions/extension_install_prompt.cc +++ b/chrome/browser/ui/views/extensions/extension_install_prompt.cc @@ -102,8 +102,7 @@ class InstallDialogContent : public views::View, public views::DialogDelegate { int height = kPanelVertMargin * 2; height += heading_->GetHeightForWidth(kRightColumnWidth); - return gfx::Size(width, - std::max(height, kIconSize + kPanelVertMargin * 2)); + return gfx::Size(width, std::max(height, kIconSize + kPanelVertMargin * 2)); } virtual void Layout() { diff --git a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc index ba9631e..c7ea367 100644 --- a/chrome/browser/ui/views/extensions/extension_install_prompt2.cc +++ b/chrome/browser/ui/views/extensions/extension_install_prompt2.cc @@ -140,10 +140,8 @@ InstallDialogContent2::InstallDialogContent2( right_column_width_ = kNoPermissionsRightColumnWidth; } else { right_column_width_ = kPermissionBoxWidth; - int label = extension->is_app() ? - IDS_EXTENSION_PROMPT2_APP_WILL_HAVE_ACCESS_TO : - IDS_EXTENSION_PROMPT2_WILL_HAVE_ACCESS_TO; - will_have_access_to_ = new views::Label(l10n_util::GetString(label)); + will_have_access_to_ = new views::Label( + l10n_util::GetString(IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO)); will_have_access_to_->SetMultiLine(true); will_have_access_to_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(will_have_access_to_); diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc index 8cb9397..4f4925d 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc @@ -11,21 +11,16 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/profile.h" -#include "chrome/browser/shell_integration.h" #include "chrome/browser/views/browser_actions_container.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/location_bar/location_bar_view.h" -#include "chrome/browser/views/tabs/base_tab.h" -#include "chrome/browser/views/tabs/base_tab_strip.h" #include "chrome/browser/views/toolbar_view.h" -#include "chrome/browser/web_applications/web_app.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_action.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" -#include "views/controls/button/checkbox.h" #include "views/controls/button/image_button.h" #include "views/controls/image_view.h" #include "views/controls/label.h" @@ -74,8 +69,7 @@ class InstalledBubbleContent : public views::View, SkBitmap* icon) : info_bubble_(NULL), type_(type), - info_(NULL), - create_shortcut_(false) { + info_(NULL) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); const gfx::Font& font = rb.GetFont(ResourceBundle::BaseFont); @@ -105,12 +99,8 @@ class InstalledBubbleContent : public views::View, AddChildView(info_); } - std::wstring text; - if (type_ == ExtensionInstalledBubble::EXTENSION_APP) - text = l10n_util::GetString(IDS_EXTENSION_APP_INSTALLED_MANAGE_INFO); - else - text = l10n_util::GetString(IDS_EXTENSION_INSTALLED_MANAGE_INFO); - manage_ = new views::Label(text); + manage_ = new views::Label( + l10n_util::GetString(IDS_EXTENSION_INSTALLED_MANAGE_INFO)); manage_->SetFont(font); manage_->SetMultiLine(true); manage_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); @@ -124,19 +114,8 @@ class InstalledBubbleContent : public views::View, close_button_->SetImage(views::CustomButton::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); AddChildView(close_button_); - - if (type_ == ExtensionInstalledBubble::EXTENSION_APP) { - create_shortcut_view_ = new views::Checkbox( - l10n_util::GetString(IDS_EXTENSION_PROMPT_CREATE_SHORTCUT)); - create_shortcut_view_->set_listener(this); - create_shortcut_view_->SetMultiLine(true); - AddChildView(create_shortcut_view_); - } } - // Whether to create a shortcut once the bubble closes. - bool create_shortcut() { return create_shortcut_;} - void set_info_bubble(InfoBubble* info_bubble) { info_bubble_ = info_bubble; } virtual void ButtonPressed( @@ -145,8 +124,6 @@ class InstalledBubbleContent : public views::View, if (sender == close_button_) { info_bubble_->set_fade_away_on_close(true); GetWidget()->Close(); - } else if (sender == create_shortcut_view_) { - create_shortcut_ = create_shortcut_view_->checked(); } else { NOTREACHED() << "Unknown view"; } @@ -170,10 +147,7 @@ class InstalledBubbleContent : public views::View, } height += manage_->GetHeightForWidth(kRightColumnWidth); height += kVertOuterMargin; - if (type_ == ExtensionInstalledBubble::EXTENSION_APP) { - height += create_shortcut_view_->GetHeightForWidth(kRightColumnWidth); - height += kVertInnerMargin; - } + return gfx::Size(width, std::max(height, kIconSize + 2 * kVertOuterMargin)); } @@ -207,16 +181,7 @@ class InstalledBubbleContent : public views::View, y += kVertInnerMargin; gfx::Size sz; - if (type_ == ExtensionInstalledBubble::EXTENSION_APP) { - sz.set_height( - create_shortcut_view_->GetHeightForWidth(kRightColumnWidth)); - sz.set_width(kRightColumnWidth); - create_shortcut_view_->SetBounds(x, y, sz.width(), sz.height()); - y += create_shortcut_view_->height(); - y += kVertInnerMargin; - } - - x += kRightColumnWidth + 2*kPanelHorizMargin + kHorizOuterMargin - + x += kRightColumnWidth + 2 * kPanelHorizMargin + kHorizOuterMargin - close_button_->GetPreferredSize().width(); y = kVertOuterMargin; sz = close_button_->GetPreferredSize(); @@ -233,11 +198,8 @@ class InstalledBubbleContent : public views::View, views::Label* heading_; views::Label* info_; views::Label* manage_; - views::Checkbox* create_shortcut_view_; views::ImageButton* close_button_; - bool create_shortcut_; - DISALLOW_COPY_AND_ASSIGN(InstalledBubbleContent); }; @@ -256,9 +218,7 @@ ExtensionInstalledBubble::ExtensionInstalledBubble(const Extension* extension, animation_wait_retries_(0) { AddRef(); // Balanced in InfoBubbleClosing. - if (extension->GetFullLaunchURL().is_valid()) { - type_ = EXTENSION_APP; - } else if (extension_->browser_action()) { + if (extension_->browser_action()) { type_ = BROWSER_ACTION; } else if (extension->page_action() && !extension->page_action()->default_icon_path().empty()) { @@ -332,11 +292,6 @@ void ExtensionInstalledBubble::ShowInternal() { reference_view = location_bar_view->GetPageActionView( extension_->page_action()); DCHECK(reference_view); - } else if (type_ == EXTENSION_APP) { - BaseTabStrip* tabstrip = browser_view->tabstrip(); - BaseTab* tab = tabstrip->GetSelectedBaseTab(); - DCHECK(tab->data().app); - reference_view = tab; } // Default case. @@ -361,28 +316,12 @@ void ExtensionInstalledBubble::ShowInternal() { // InfoBubbleDelegate void ExtensionInstalledBubble::InfoBubbleClosing(InfoBubble* info_bubble, bool closed_by_escape) { - if (extension_) { - if (type_ == PAGE_ACTION) { - BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( - browser_->window()->GetNativeHandle()); - browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( - extension_->page_action(), - false); // preview_enabled - } else if (type_ == EXTENSION_APP) { - if (bubble_content_->create_shortcut()) { - ShellIntegration::ShortcutInfo shortcut_info; - shortcut_info.url = extension_->GetFullLaunchURL(); - shortcut_info.extension_id = UTF8ToUTF16(extension_->id()); - shortcut_info.title = UTF8ToUTF16(extension_->name()); - shortcut_info.description = UTF8ToUTF16(extension_->description()); - shortcut_info.favicon = icon_; - shortcut_info.create_on_desktop = true; - shortcut_info.create_in_applications_menu = false; - shortcut_info.create_in_quick_launch_bar = false; - web_app::CreateShortcut(browser_->profile()->GetPath(), shortcut_info, - NULL); - } - } + if (extension_ && type_ == PAGE_ACTION) { + BrowserView* browser_view = BrowserView::GetBrowserViewForNativeWindow( + browser_->window()->GetNativeHandle()); + browser_view->GetLocationBarView()->SetPreviewEnabledPageAction( + extension_->page_action(), + false); // preview_enabled } Release(); // Balanced in ctor. diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.h b/chrome/browser/ui/views/extensions/extension_installed_bubble.h index 7ff6d82..be213b0 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.h +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.h @@ -36,7 +36,6 @@ class ExtensionInstalledBubble enum BubbleType { BROWSER_ACTION, PAGE_ACTION, - EXTENSION_APP, GENERIC }; diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 2bbf99b..8b9c39f 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -218,17 +218,17 @@ const char Extension::kWebstorePrivatePermission[] = "webstorePrivate"; // exception. const Extension::Permission Extension::kPermissions[] = { { kBackgroundPermission, 0 }, - { kBookmarkPermission, IDS_EXTENSION_PROMPT2_WARNING_BOOKMARKS }, + { kBookmarkPermission, IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS }, { kContextMenusPermission, 0 }, { kCookiePermission, 0 }, { kExperimentalPermission, 0 }, - { kGeolocationPermission, IDS_EXTENSION_PROMPT2_WARNING_GEOLOCATION }, + { kGeolocationPermission, IDS_EXTENSION_PROMPT_WARNING_GEOLOCATION }, { kIdlePermission, 0 }, - { kHistoryPermission, IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY }, - { kManagementPermission, IDS_EXTENSION_PROMPT2_WARNING_MANAGEMENT }, + { kHistoryPermission, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY }, + { kManagementPermission, IDS_EXTENSION_PROMPT_WARNING_MANAGEMENT }, { kNotificationPermission, 0 }, { kProxyPermission, 0 }, - { kTabPermission, IDS_EXTENSION_PROMPT2_WARNING_BROWSING_HISTORY }, + { kTabPermission, IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY }, { kUnlimitedStoragePermission, 0 }, { kWebstorePrivatePermission, 0 }, }; @@ -273,7 +273,7 @@ std::vector<string16> Extension::GetPermissionMessages() const { std::vector<string16> messages; if (!plugins().empty()) { messages.push_back( - l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT2_WARNING_FULL_ACCESS)); + l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_FULL_ACCESS)); return messages; } @@ -331,24 +331,24 @@ std::vector<std::string> Extension::GetDistinctHosts( string16 Extension::GetHostPermissionMessage() const { if (HasEffectiveAccessToAllHosts()) - return l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT2_WARNING_ALL_HOSTS); + return l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_ALL_HOSTS); std::vector<std::string> hosts = GetDistinctHosts(); if (hosts.size() == 1) { - return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT2_WARNING_1_HOST, + return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_1_HOST, UTF8ToUTF16(hosts[0])); } else if (hosts.size() == 2) { - return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT2_WARNING_2_HOSTS, + return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_2_HOSTS, UTF8ToUTF16(hosts[0]), UTF8ToUTF16(hosts[1])); } else if (hosts.size() == 3) { - return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT2_WARNING_3_HOSTS, + return l10n_util::GetStringFUTF16(IDS_EXTENSION_PROMPT_WARNING_3_HOSTS, UTF8ToUTF16(hosts[0]), UTF8ToUTF16(hosts[1]), UTF8ToUTF16(hosts[2])); } else if (hosts.size() >= 4) { return l10n_util::GetStringFUTF16( - IDS_EXTENSION_PROMPT2_WARNING_4_OR_MORE_HOSTS, + IDS_EXTENSION_PROMPT_WARNING_4_OR_MORE_HOSTS, UTF8ToUTF16(hosts[0]), UTF8ToUTF16(hosts[1]), base::IntToString16(hosts.size() - 2)); |