diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-29 00:33:59 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-29 00:33:59 +0000 |
commit | 18608c49395a6bda33a32ad6a286227a1eb76c2f (patch) | |
tree | e84729cf59378d956b502e3871f797df93a3e4eb /chrome/browser/dom_ui/options | |
parent | c4a065c728d22c2a2d57fa6d6f675ef9f1ae73c3 (diff) | |
download | chromium_src-18608c49395a6bda33a32ad6a286227a1eb76c2f.zip chromium_src-18608c49395a6bda33a32ad6a286227a1eb76c2f.tar.gz chromium_src-18608c49395a6bda33a32ad6a286227a1eb76c2f.tar.bz2 |
chromeos: Fix DOMUI about:credits link.
The renderer doesn't let us link to about:credits, so make
the DOMUI settings page link to chrome://about/credits
instead (and initialize the about handler's data source when
the settings page is opened). Also open these links in new
tabs instead of in the current one.
BUG=chromium-os:6728
TEST=built for chrome os and linux and checked that credits links work in both cases
Review URL: http://codereview.chromium.org/5315006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/options')
-rw-r--r-- | chrome/browser/dom_ui/options/about_page_handler.cc | 6 | ||||
-rw-r--r-- | chrome/browser/dom_ui/options/options_ui.cc | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/dom_ui/options/about_page_handler.cc b/chrome/browser/dom_ui/options/about_page_handler.cc index 71f994f7..224befb 100644 --- a/chrome/browser/dom_ui/options/about_page_handler.cc +++ b/chrome/browser/dom_ui/options/about_page_handler.cc @@ -192,14 +192,16 @@ void AboutPageHandler::GetLocalizedValues(DictionaryValue* localized_strings) { "license_link_0" : "license_link_1", l10n_util::GetStringUTF16(IDS_CHROMIUM_PROJECT_URL)); - // The Open Source link within the main text of the dialog. + // The Open Source link within the main text of the dialog. We need to use + // the chrome:// variant instead of about:credits; the latter will get + // rewritten to about:blank. localized_strings->SetString(chromium_url_appears_first ? "license_link_content_1" : "license_link_content_0", WideToUTF16Hack(StringSubRange(text, text.find(kBeginLinkOss) + wcslen(kBeginLinkOss), text.find(kEndLinkOss)))); localized_strings->SetString(chromium_url_appears_first ? - "license_link_1" : "license_link_0", chrome::kAboutCreditsURL); + "license_link_1" : "license_link_0", chrome::kChromeUIAboutCreditsURL); // webkit diff --git a/chrome/browser/dom_ui/options/options_ui.cc b/chrome/browser/dom_ui/options/options_ui.cc index 867b4fb..36014a1 100644 --- a/chrome/browser/dom_ui/options/options_ui.cc +++ b/chrome/browser/dom_ui/options/options_ui.cc @@ -17,6 +17,7 @@ #include "base/thread.h" #include "base/time.h" #include "base/values.h" +#include "chrome/browser/browser_about_handler.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/dom_ui/dom_ui_theme_source.h" #include "chrome/browser/dom_ui/options/about_page_handler.h" @@ -46,13 +47,12 @@ #include "chrome/common/notification_type.h" #include "chrome/common/time_format.h" #include "chrome/common/url_constants.h" -#include "net/base/escape.h" - #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" +#include "net/base/escape.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/dom_ui/accounts_options_handler.h" @@ -202,7 +202,7 @@ OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) { &ChromeURLDataManager::AddDataSource, make_scoped_refptr(html_source))); - // Set up chrome://theme/ source. + // Set up the chrome://theme/ source. DOMUIThemeSource* theme = new DOMUIThemeSource(GetProfile()); BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -210,6 +210,10 @@ OptionsUI::OptionsUI(TabContents* contents) : DOMUI(contents) { ChromeURLDataManager::GetInstance(), &ChromeURLDataManager::AddDataSource, make_scoped_refptr(theme))); + + // Initialize the chrome://about/ source in case the user clicks the credits + // link. + InitializeAboutDataSource(); } OptionsUI::~OptionsUI() { |