| OLD | NEW |
| 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 #include "chrome/browser/ui/webui/options/font_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/font_settings_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/extensions/extension_tab_util.h" | 23 #include "chrome/browser/extensions/extension_tab_util.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
| 26 #include "chrome/browser/ui/webui/options/font_settings_utils.h" | 26 #include "chrome/browser/ui/webui/options/font_settings_utils.h" |
| 27 #include "chrome/common/extensions/extension.h" | 27 #include "chrome/common/extensions/extension.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "content/public/browser/font_list_async.h" | 29 #include "content/public/browser/font_list_async.h" |
| 30 #include "content/public/browser/notification_details.h" | 30 #include "content/public/browser/notification_details.h" |
| 31 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 32 #include "content/public/browser/web_ui.h" | 32 #include "content/public/browser/web_ui.h" |
| 33 #include "extensions/common/extension_urls.h" |
| 33 #include "grit/chromium_strings.h" | 34 #include "grit/chromium_strings.h" |
| 34 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 35 #include "ui/base/l10n/l10n_util.h" | 36 #include "ui/base/l10n/l10n_util.h" |
| 36 #include "url/gurl.h" | 37 #include "url/gurl.h" |
| 37 | 38 |
| 38 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 39 #include "ui/gfx/font.h" | 40 #include "ui/gfx/font.h" |
| 40 #include "ui/gfx/platform_font_win.h" | 41 #include "ui/gfx/platform_font_win.h" |
| 41 #endif | 42 #endif |
| 42 | 43 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 IDS_FONT_LANGUAGE_SETTING_ADVANCED_FONT_SETTINGS_OPTIONS } | 97 IDS_FONT_LANGUAGE_SETTING_ADVANCED_FONT_SETTINGS_OPTIONS } |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 RegisterStrings(localized_strings, resources, arraysize(resources)); | 100 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 100 RegisterTitle(localized_strings, "fontSettingsPage", | 101 RegisterTitle(localized_strings, "fontSettingsPage", |
| 101 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE); | 102 IDS_FONT_LANGUAGE_SETTING_FONT_TAB_TITLE); |
| 102 localized_strings->SetString("fontSettingsPlaceholder", | 103 localized_strings->SetString("fontSettingsPlaceholder", |
| 103 l10n_util::GetStringUTF16( | 104 l10n_util::GetStringUTF16( |
| 104 IDS_FONT_LANGUAGE_SETTING_PLACEHOLDER)); | 105 IDS_FONT_LANGUAGE_SETTING_PLACEHOLDER)); |
| 105 | 106 |
| 106 GURL install_url(extension_urls::GetWebstoreItemDetailURLPrefix()); | 107 GURL install_url(extensions::GetWebstoreItemDetailURLPrefix()); |
| 107 localized_strings->SetString("advancedFontSettingsInstall", | 108 localized_strings->SetString("advancedFontSettingsInstall", |
| 108 l10n_util::GetStringFUTF16( | 109 l10n_util::GetStringFUTF16( |
| 109 IDS_FONT_LANGUAGE_SETTING_ADVANCED_FONT_SETTINGS_INSTALL, | 110 IDS_FONT_LANGUAGE_SETTING_ADVANCED_FONT_SETTINGS_INSTALL, |
| 110 UTF8ToUTF16( | 111 UTF8ToUTF16( |
| 111 install_url.Resolve(kAdvancedFontSettingsExtensionId).spec()))); | 112 install_url.Resolve(kAdvancedFontSettingsExtensionId).spec()))); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void FontSettingsHandler::InitializeHandler() { | 115 void FontSettingsHandler::InitializeHandler() { |
| 115 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 116 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 116 content::NotificationService::AllSources()); | 117 content::NotificationService::AllSources()); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); | 309 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); |
| 309 } | 310 } |
| 310 | 311 |
| 311 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() { | 312 void FontSettingsHandler::OnWebKitDefaultFontSizeChanged() { |
| 312 SetUpStandardFontSample(); | 313 SetUpStandardFontSample(); |
| 313 SetUpSerifFontSample(); | 314 SetUpSerifFontSample(); |
| 314 SetUpSansSerifFontSample(); | 315 SetUpSansSerifFontSample(); |
| 315 } | 316 } |
| 316 | 317 |
| 317 } // namespace options | 318 } // namespace options |
| OLD | NEW |