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

Side by Side Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 10540022: mac: Plumbing for the emoji font. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whoops Created 8 years, 2 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 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" 5 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // all platforms have fonts for all scripts for all generic families. 152 // all platforms have fonts for all scripts for all generic families.
153 // TODO(falken): add proper defaults when possible for all 153 // TODO(falken): add proper defaults when possible for all
154 // platforms/scripts/generic families. 154 // platforms/scripts/generic families.
155 const FontDefault kFontDefaults[] = { 155 const FontDefault kFontDefaults[] = {
156 { prefs::kWebKitStandardFontFamily, IDS_STANDARD_FONT_FAMILY }, 156 { prefs::kWebKitStandardFontFamily, IDS_STANDARD_FONT_FAMILY },
157 { prefs::kWebKitFixedFontFamily, IDS_FIXED_FONT_FAMILY }, 157 { prefs::kWebKitFixedFontFamily, IDS_FIXED_FONT_FAMILY },
158 { prefs::kWebKitSerifFontFamily, IDS_SERIF_FONT_FAMILY }, 158 { prefs::kWebKitSerifFontFamily, IDS_SERIF_FONT_FAMILY },
159 { prefs::kWebKitSansSerifFontFamily, IDS_SANS_SERIF_FONT_FAMILY }, 159 { prefs::kWebKitSansSerifFontFamily, IDS_SANS_SERIF_FONT_FAMILY },
160 { prefs::kWebKitCursiveFontFamily, IDS_CURSIVE_FONT_FAMILY }, 160 { prefs::kWebKitCursiveFontFamily, IDS_CURSIVE_FONT_FAMILY },
161 { prefs::kWebKitFantasyFontFamily, IDS_FANTASY_FONT_FAMILY }, 161 { prefs::kWebKitFantasyFontFamily, IDS_FANTASY_FONT_FAMILY },
162 { prefs::kWebKitPictographFontFamily, IDS_PICTOGRAPH_FONT_FAMILY },
162 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN) 163 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN)
163 { prefs::kWebKitStandardFontFamilyJapanese, 164 { prefs::kWebKitStandardFontFamilyJapanese,
164 IDS_STANDARD_FONT_FAMILY_JAPANESE }, 165 IDS_STANDARD_FONT_FAMILY_JAPANESE },
165 { prefs::kWebKitFixedFontFamilyJapanese, IDS_FIXED_FONT_FAMILY_JAPANESE }, 166 { prefs::kWebKitFixedFontFamilyJapanese, IDS_FIXED_FONT_FAMILY_JAPANESE },
166 { prefs::kWebKitSerifFontFamilyJapanese, IDS_SERIF_FONT_FAMILY_JAPANESE }, 167 { prefs::kWebKitSerifFontFamilyJapanese, IDS_SERIF_FONT_FAMILY_JAPANESE },
167 { prefs::kWebKitSansSerifFontFamilyJapanese, 168 { prefs::kWebKitSansSerifFontFamilyJapanese,
168 IDS_SANS_SERIF_FONT_FAMILY_JAPANESE }, 169 IDS_SANS_SERIF_FONT_FAMILY_JAPANESE },
169 { prefs::kWebKitStandardFontFamilyKorean, IDS_STANDARD_FONT_FAMILY_KOREAN }, 170 { prefs::kWebKitStandardFontFamilyKorean, IDS_STANDARD_FONT_FAMILY_KOREAN },
170 { prefs::kWebKitSerifFontFamilyKorean, IDS_SERIF_FONT_FAMILY_KOREAN }, 171 { prefs::kWebKitSerifFontFamilyKorean, IDS_SERIF_FONT_FAMILY_KOREAN },
171 { prefs::kWebKitSansSerifFontFamilyKorean, 172 { prefs::kWebKitSansSerifFontFamilyKorean,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 RegisterFontFamilyMapObserver(&pref_change_registrar_, 361 RegisterFontFamilyMapObserver(&pref_change_registrar_,
361 prefs::kWebKitFixedFontFamilyMap, this); 362 prefs::kWebKitFixedFontFamilyMap, this);
362 RegisterFontFamilyMapObserver(&pref_change_registrar_, 363 RegisterFontFamilyMapObserver(&pref_change_registrar_,
363 prefs::kWebKitSerifFontFamilyMap, this); 364 prefs::kWebKitSerifFontFamilyMap, this);
364 RegisterFontFamilyMapObserver(&pref_change_registrar_, 365 RegisterFontFamilyMapObserver(&pref_change_registrar_,
365 prefs::kWebKitSansSerifFontFamilyMap, this); 366 prefs::kWebKitSansSerifFontFamilyMap, this);
366 RegisterFontFamilyMapObserver(&pref_change_registrar_, 367 RegisterFontFamilyMapObserver(&pref_change_registrar_,
367 prefs::kWebKitCursiveFontFamilyMap, this); 368 prefs::kWebKitCursiveFontFamilyMap, this);
368 RegisterFontFamilyMapObserver(&pref_change_registrar_, 369 RegisterFontFamilyMapObserver(&pref_change_registrar_,
369 prefs::kWebKitFantasyFontFamilyMap, this); 370 prefs::kWebKitFantasyFontFamilyMap, this);
371 RegisterFontFamilyMapObserver(&pref_change_registrar_,
372 prefs::kWebKitPictographFontFamilyMap, this);
370 } 373 }
371 374
372 renderer_preferences_util::UpdateFromSystemSettings( 375 renderer_preferences_util::UpdateFromSystemSettings(
373 web_contents_->GetMutableRendererPrefs(), GetProfile()); 376 web_contents_->GetMutableRendererPrefs(), GetProfile());
374 377
375 registrar_.Add(this, chrome::NOTIFICATION_USER_STYLE_SHEET_UPDATED, 378 registrar_.Add(this, chrome::NOTIFICATION_USER_STYLE_SHEET_UPDATED,
376 content::NotificationService::AllSources()); 379 content::NotificationService::AllSources());
377 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) 380 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES)
378 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 381 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
379 content::Source<ThemeService>( 382 content::Source<ThemeService>(
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 489 }
487 } 490 }
488 491
489 // Register font prefs that don't have defaults. 492 // Register font prefs that don't have defaults.
490 RegisterFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap); 493 RegisterFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap);
491 RegisterFontFamilyMap(prefs, prefs::kWebKitFixedFontFamilyMap); 494 RegisterFontFamilyMap(prefs, prefs::kWebKitFixedFontFamilyMap);
492 RegisterFontFamilyMap(prefs, prefs::kWebKitSerifFontFamilyMap); 495 RegisterFontFamilyMap(prefs, prefs::kWebKitSerifFontFamilyMap);
493 RegisterFontFamilyMap(prefs, prefs::kWebKitSansSerifFontFamilyMap); 496 RegisterFontFamilyMap(prefs, prefs::kWebKitSansSerifFontFamilyMap);
494 RegisterFontFamilyMap(prefs, prefs::kWebKitCursiveFontFamilyMap); 497 RegisterFontFamilyMap(prefs, prefs::kWebKitCursiveFontFamilyMap);
495 RegisterFontFamilyMap(prefs, prefs::kWebKitFantasyFontFamilyMap); 498 RegisterFontFamilyMap(prefs, prefs::kWebKitFantasyFontFamilyMap);
499 RegisterFontFamilyMap(prefs, prefs::kWebKitPictographFontFamilyMap);
496 500
497 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize, 501 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize,
498 IDS_DEFAULT_FONT_SIZE, 502 IDS_DEFAULT_FONT_SIZE,
499 PrefService::UNSYNCABLE_PREF); 503 PrefService::UNSYNCABLE_PREF);
500 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFixedFontSize, 504 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFixedFontSize,
501 IDS_DEFAULT_FIXED_FONT_SIZE, 505 IDS_DEFAULT_FIXED_FONT_SIZE,
502 PrefService::UNSYNCABLE_PREF); 506 PrefService::UNSYNCABLE_PREF);
503 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumFontSize, 507 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumFontSize,
504 IDS_MINIMUM_FONT_SIZE, 508 IDS_MINIMUM_FONT_SIZE,
505 PrefService::UNSYNCABLE_PREF); 509 PrefService::UNSYNCABLE_PREF);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 564
561 void PrefsTabHelper::UpdateRendererPreferences() { 565 void PrefsTabHelper::UpdateRendererPreferences() {
562 renderer_preferences_util::UpdateFromSystemSettings( 566 renderer_preferences_util::UpdateFromSystemSettings(
563 web_contents_->GetMutableRendererPrefs(), GetProfile()); 567 web_contents_->GetMutableRendererPrefs(), GetProfile());
564 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); 568 web_contents_->GetRenderViewHost()->SyncRendererPrefs();
565 } 569 }
566 570
567 Profile* PrefsTabHelper::GetProfile() { 571 Profile* PrefsTabHelper::GetProfile() {
568 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 572 return Profile::FromBrowserContext(web_contents_->GetBrowserContext());
569 } 573 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698