| 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/prefs/prefs_tab_helper.h" | 5 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/prefs/overlay_user_pref_store.h" | 10 #include "chrome/browser/prefs/overlay_user_pref_store.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 using webkit_glue::WebPreferences; | 29 using webkit_glue::WebPreferences; |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 static void RegisterFontsAndCharsetPrefs(PrefService* prefs) { | 33 static void RegisterFontsAndCharsetPrefs(PrefService* prefs) { |
| 34 WebPreferences pref_defaults; | 34 WebPreferences pref_defaults; |
| 35 | 35 |
| 36 prefs->RegisterLocalizedStringPref(prefs::kDefaultCharset, | 36 prefs->RegisterLocalizedStringPref(prefs::kDefaultCharset, |
| 37 IDS_DEFAULT_ENCODING, | 37 IDS_DEFAULT_ENCODING, |
| 38 PrefService::SYNCABLE_PREF); | 38 PrefService::SYNCABLE_PREF); |
| 39 prefs->RegisterLocalizedStringPref(prefs::kWebKitStandardFontFamily, | |
| 40 IDS_STANDARD_FONT_FAMILY, | |
| 41 PrefService::UNSYNCABLE_PREF); | |
| 42 prefs->RegisterLocalizedStringPref(prefs::kWebKitFixedFontFamily, | |
| 43 IDS_FIXED_FONT_FAMILY, | |
| 44 PrefService::UNSYNCABLE_PREF); | |
| 45 prefs->RegisterLocalizedStringPref(prefs::kWebKitSerifFontFamily, | |
| 46 IDS_SERIF_FONT_FAMILY, | |
| 47 PrefService::UNSYNCABLE_PREF); | |
| 48 prefs->RegisterLocalizedStringPref(prefs::kWebKitSansSerifFontFamily, | |
| 49 IDS_SANS_SERIF_FONT_FAMILY, | |
| 50 PrefService::UNSYNCABLE_PREF); | |
| 51 prefs->RegisterLocalizedStringPref(prefs::kWebKitCursiveFontFamily, | |
| 52 IDS_CURSIVE_FONT_FAMILY, | |
| 53 PrefService::UNSYNCABLE_PREF); | |
| 54 prefs->RegisterLocalizedStringPref(prefs::kWebKitFantasyFontFamily, | |
| 55 IDS_FANTASY_FONT_FAMILY, | |
| 56 PrefService::UNSYNCABLE_PREF); | |
| 57 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize, | 39 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFontSize, |
| 58 IDS_DEFAULT_FONT_SIZE, | 40 IDS_DEFAULT_FONT_SIZE, |
| 59 PrefService::UNSYNCABLE_PREF); | 41 PrefService::UNSYNCABLE_PREF); |
| 60 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFixedFontSize, | 42 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitDefaultFixedFontSize, |
| 61 IDS_DEFAULT_FIXED_FONT_SIZE, | 43 IDS_DEFAULT_FIXED_FONT_SIZE, |
| 62 PrefService::UNSYNCABLE_PREF); | 44 PrefService::UNSYNCABLE_PREF); |
| 63 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumFontSize, | 45 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumFontSize, |
| 64 IDS_MINIMUM_FONT_SIZE, | 46 IDS_MINIMUM_FONT_SIZE, |
| 65 PrefService::UNSYNCABLE_PREF); | 47 PrefService::UNSYNCABLE_PREF); |
| 66 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumLogicalFontSize, | 48 prefs->RegisterLocalizedIntegerPref(prefs::kWebKitMinimumLogicalFontSize, |
| 67 IDS_MINIMUM_LOGICAL_FONT_SIZE, | 49 IDS_MINIMUM_LOGICAL_FONT_SIZE, |
| 68 PrefService::UNSYNCABLE_PREF); | 50 PrefService::UNSYNCABLE_PREF); |
| 51 |
| 52 // These are only registered to be used in migration. |
| 53 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldStandardFontFamily, |
| 54 IDS_STANDARD_FONT_FAMILY, |
| 55 PrefService::UNSYNCABLE_PREF); |
| 56 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldFixedFontFamily, |
| 57 IDS_FIXED_FONT_FAMILY, |
| 58 PrefService::UNSYNCABLE_PREF); |
| 59 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldSerifFontFamily, |
| 60 IDS_SERIF_FONT_FAMILY, |
| 61 PrefService::UNSYNCABLE_PREF); |
| 62 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldSansSerifFontFamily, |
| 63 IDS_SANS_SERIF_FONT_FAMILY, |
| 64 PrefService::UNSYNCABLE_PREF); |
| 65 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldCursiveFontFamily, |
| 66 IDS_CURSIVE_FONT_FAMILY, |
| 67 PrefService::UNSYNCABLE_PREF); |
| 68 prefs->RegisterLocalizedStringPref(prefs::kWebKitOldFantasyFontFamily, |
| 69 IDS_FANTASY_FONT_FAMILY, |
| 70 PrefService::UNSYNCABLE_PREF); |
| 71 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalStandardFontFamily, |
| 72 IDS_STANDARD_FONT_FAMILY, |
| 73 PrefService::UNSYNCABLE_PREF); |
| 74 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFixedFontFamily, |
| 75 IDS_FIXED_FONT_FAMILY, |
| 76 PrefService::UNSYNCABLE_PREF); |
| 77 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSerifFontFamily, |
| 78 IDS_SERIF_FONT_FAMILY, |
| 79 PrefService::UNSYNCABLE_PREF); |
| 80 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSansSerifFontFamily, |
| 81 IDS_SANS_SERIF_FONT_FAMILY, |
| 82 PrefService::UNSYNCABLE_PREF); |
| 83 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalCursiveFontFamily, |
| 84 IDS_CURSIVE_FONT_FAMILY, |
| 85 PrefService::UNSYNCABLE_PREF); |
| 86 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFantasyFontFamily, |
| 87 IDS_FANTASY_FONT_FAMILY, |
| 88 PrefService::UNSYNCABLE_PREF); |
| 69 } | 89 } |
| 70 | 90 |
| 71 // The list of prefs we want to observe. | 91 // The list of prefs we want to observe. |
| 72 const char* kPrefsToObserve[] = { | 92 const char* kPrefsToObserve[] = { |
| 73 prefs::kDefaultZoomLevel, | 93 prefs::kDefaultZoomLevel, |
| 74 prefs::kGlobalDefaultCharset, | 94 prefs::kGlobalDefaultCharset, |
| 75 prefs::kEnableReferrers, | 95 prefs::kEnableReferrers, |
| 76 prefs::kWebKitAllowDisplayingInsecureContent, | 96 prefs::kWebKitAllowDisplayingInsecureContent, |
| 77 prefs::kWebKitAllowRunningInsecureContent, | 97 prefs::kWebKitAllowRunningInsecureContent, |
| 78 prefs::kWebKitGlobalCursiveFontFamily, | |
| 79 prefs::kWebKitGlobalDefaultFixedFontSize, | 98 prefs::kWebKitGlobalDefaultFixedFontSize, |
| 80 prefs::kWebKitGlobalDefaultFontSize, | 99 prefs::kWebKitGlobalDefaultFontSize, |
| 81 prefs::kWebKitGlobalFantasyFontFamily, | |
| 82 prefs::kWebKitGlobalFixedFontFamily, | |
| 83 prefs::kWebKitGlobalJavascriptEnabled, | 100 prefs::kWebKitGlobalJavascriptEnabled, |
| 84 prefs::kWebKitJavaEnabled, | 101 prefs::kWebKitJavaEnabled, |
| 85 prefs::kWebKitGlobalLoadsImagesAutomatically, | 102 prefs::kWebKitGlobalLoadsImagesAutomatically, |
| 86 prefs::kWebKitGlobalMinimumFontSize, | 103 prefs::kWebKitGlobalMinimumFontSize, |
| 87 prefs::kWebKitGlobalMinimumLogicalFontSize, | 104 prefs::kWebKitGlobalMinimumLogicalFontSize, |
| 88 prefs::kWebKitGlobalPluginsEnabled, | 105 prefs::kWebKitGlobalPluginsEnabled, |
| 89 prefs::kWebKitGlobalSansSerifFontFamily, | |
| 90 prefs::kWebKitGlobalSerifFontFamily, | |
| 91 prefs::kWebKitGlobalStandardFontFamily, | |
| 92 prefs::kWebkitTabsToLinks, | 106 prefs::kWebkitTabsToLinks, |
| 93 prefs::kWebKitUsesUniversalDetector | 107 prefs::kWebKitUsesUniversalDetector |
| 94 }; | 108 }; |
| 95 | 109 |
| 96 const int kPrefsToObserveLength = arraysize(kPrefsToObserve); | 110 const int kPrefsToObserveLength = arraysize(kPrefsToObserve); |
| 97 | 111 |
| 98 // Registers a preference under the path |map_name| for each script used for | 112 // Registers a preference under the path |map_name| for each script used for |
| 99 // per-script font prefs. For example, if |map_name| is "fonts.serif", then | 113 // per-script font prefs. For example, if |map_name| is "fonts.serif", then |
| 100 // "fonts.serif.Arab", "fonts.serif.Hang", etc. are registered. | 114 // "fonts.serif.Arab", "fonts.serif.Hang", etc. are registered. |
| 101 void RegisterFontFamilyMap(PrefService* prefs, const char* map_name) { | 115 void RegisterFontFamilyMap(PrefService* prefs, const char* map_name) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // causes a warning due to comparison of unsigned expression < 0. | 250 // causes a warning due to comparison of unsigned expression < 0. |
| 237 const size_t kPerScriptFontDefaultsLength = arraysize(kPerScriptFontDefaults); | 251 const size_t kPerScriptFontDefaultsLength = arraysize(kPerScriptFontDefaults); |
| 238 #endif | 252 #endif |
| 239 | 253 |
| 240 const struct { | 254 const struct { |
| 241 const char* from; | 255 const char* from; |
| 242 const char* to; | 256 const char* to; |
| 243 } kPrefNamesToMigrate[] = { | 257 } kPrefNamesToMigrate[] = { |
| 244 { prefs::kDefaultCharset, | 258 { prefs::kDefaultCharset, |
| 245 prefs::kGlobalDefaultCharset }, | 259 prefs::kGlobalDefaultCharset }, |
| 246 { prefs::kWebKitCursiveFontFamily, | |
| 247 prefs::kWebKitGlobalCursiveFontFamily }, | |
| 248 { prefs::kWebKitDefaultFixedFontSize, | 260 { prefs::kWebKitDefaultFixedFontSize, |
| 249 prefs::kWebKitGlobalDefaultFixedFontSize }, | 261 prefs::kWebKitGlobalDefaultFixedFontSize }, |
| 250 { prefs::kWebKitDefaultFontSize, | 262 { prefs::kWebKitDefaultFontSize, |
| 251 prefs::kWebKitGlobalDefaultFontSize }, | 263 prefs::kWebKitGlobalDefaultFontSize }, |
| 252 { prefs::kWebKitFantasyFontFamily, | |
| 253 prefs::kWebKitGlobalFantasyFontFamily }, | |
| 254 { prefs::kWebKitFixedFontFamily, | |
| 255 prefs::kWebKitGlobalFixedFontFamily }, | |
| 256 { prefs::kWebKitMinimumFontSize, | 264 { prefs::kWebKitMinimumFontSize, |
| 257 prefs::kWebKitGlobalMinimumFontSize }, | 265 prefs::kWebKitGlobalMinimumFontSize }, |
| 258 { prefs::kWebKitMinimumLogicalFontSize, | 266 { prefs::kWebKitMinimumLogicalFontSize, |
| 259 prefs::kWebKitGlobalMinimumLogicalFontSize }, | 267 prefs::kWebKitGlobalMinimumLogicalFontSize }, |
| 260 { prefs::kWebKitSansSerifFontFamily, | 268 |
| 261 prefs::kWebKitGlobalSansSerifFontFamily }, | 269 // Migrate prefs like "webkit.webprefs.standard_font_family" to |
| 262 { prefs::kWebKitSerifFontFamily, | 270 // "webkit.webprefs.fonts.standard.Zyyy". This moves the formerly |
| 263 prefs::kWebKitGlobalSerifFontFamily }, | 271 // "non-per-script" font prefs into the per-script font pref maps, as the |
| 264 { prefs::kWebKitStandardFontFamily, | 272 // entry for the "Common" script (Zyyy is the ISO 15924 script code for the |
| 265 prefs::kWebKitGlobalStandardFontFamily }, | 273 // Common script). The |from| prefs will exist if the migration to global |
| 274 // prefs (for the per-tab pref mechanism, which has since been removed) never |
| 275 // occurred. |
| 276 { prefs::kWebKitOldCursiveFontFamily, |
| 277 prefs::kWebKitCursiveFontFamily }, |
| 278 { prefs::kWebKitOldFantasyFontFamily, |
| 279 prefs::kWebKitFantasyFontFamily }, |
| 280 { prefs::kWebKitOldFixedFontFamily, |
| 281 prefs::kWebKitFixedFontFamily }, |
| 282 { prefs::kWebKitOldSansSerifFontFamily, |
| 283 prefs::kWebKitSansSerifFontFamily }, |
| 284 { prefs::kWebKitOldSerifFontFamily, |
| 285 prefs::kWebKitSerifFontFamily }, |
| 286 { prefs::kWebKitOldStandardFontFamily, |
| 287 prefs::kWebKitStandardFontFamily }, |
| 288 |
| 289 // Migrate "global" prefs. These will exist if the migration to global prefs |
| 290 // (for the per-tab pref mechanism, which has since been removed) occurred. |
| 291 // In addition, this moves the formerly "non-per-script" font prefs into the |
| 292 // per-script font pref maps, as above. |
| 293 { prefs::kWebKitGlobalCursiveFontFamily, |
| 294 prefs::kWebKitCursiveFontFamily }, |
| 295 { prefs::kWebKitGlobalFantasyFontFamily, |
| 296 prefs::kWebKitFantasyFontFamily }, |
| 297 { prefs::kWebKitGlobalFixedFontFamily, |
| 298 prefs::kWebKitFixedFontFamily }, |
| 299 { prefs::kWebKitGlobalSansSerifFontFamily, |
| 300 prefs::kWebKitSansSerifFontFamily }, |
| 301 { prefs::kWebKitGlobalSerifFontFamily, |
| 302 prefs::kWebKitSerifFontFamily }, |
| 303 { prefs::kWebKitGlobalStandardFontFamily, |
| 304 prefs::kWebKitStandardFontFamily } |
| 266 }; | 305 }; |
| 267 | 306 |
| 268 const int kPrefsToMigrateLength = ARRAYSIZE_UNSAFE(kPrefNamesToMigrate); | 307 const int kPrefsToMigrateLength = ARRAYSIZE_UNSAFE(kPrefNamesToMigrate); |
| 269 | 308 |
| 270 static void MigratePreferences(PrefService* prefs) { | 309 static void MigratePreferences(PrefService* prefs) { |
| 271 RegisterFontsAndCharsetPrefs(prefs); | 310 RegisterFontsAndCharsetPrefs(prefs); |
| 272 for (int i = 0; i < kPrefsToMigrateLength; ++i) { | 311 for (int i = 0; i < kPrefsToMigrateLength; ++i) { |
| 273 const PrefService::Preference *pref = | 312 const PrefService::Preference *pref = |
| 274 prefs->FindPreference(kPrefNamesToMigrate[i].from); | 313 prefs->FindPreference(kPrefNamesToMigrate[i].from); |
| 275 if (!pref) continue; | 314 if (!pref) continue; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 PrefService::SYNCABLE_PREF); | 417 PrefService::SYNCABLE_PREF); |
| 379 #else | 418 #else |
| 380 // Not used in OSX. | 419 // Not used in OSX. |
| 381 prefs->RegisterLocalizedStringPref(prefs::kAcceptLanguages, | 420 prefs->RegisterLocalizedStringPref(prefs::kAcceptLanguages, |
| 382 IDS_ACCEPT_LANGUAGES, | 421 IDS_ACCEPT_LANGUAGES, |
| 383 PrefService::UNSYNCABLE_PREF); | 422 PrefService::UNSYNCABLE_PREF); |
| 384 #endif | 423 #endif |
| 385 prefs->RegisterLocalizedStringPref(prefs::kGlobalDefaultCharset, | 424 prefs->RegisterLocalizedStringPref(prefs::kGlobalDefaultCharset, |
| 386 IDS_DEFAULT_ENCODING, | 425 IDS_DEFAULT_ENCODING, |
| 387 PrefService::SYNCABLE_PREF); | 426 PrefService::SYNCABLE_PREF); |
| 388 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalStandardFontFamily, | 427 prefs->RegisterLocalizedStringPref(prefs::kWebKitStandardFontFamily, |
| 389 IDS_STANDARD_FONT_FAMILY, | 428 IDS_STANDARD_FONT_FAMILY, |
| 390 PrefService::UNSYNCABLE_PREF); | 429 PrefService::UNSYNCABLE_PREF); |
| 391 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFixedFontFamily, | 430 prefs->RegisterLocalizedStringPref(prefs::kWebKitFixedFontFamily, |
| 392 IDS_FIXED_FONT_FAMILY, | 431 IDS_FIXED_FONT_FAMILY, |
| 393 PrefService::UNSYNCABLE_PREF); | 432 PrefService::UNSYNCABLE_PREF); |
| 394 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSerifFontFamily, | 433 prefs->RegisterLocalizedStringPref(prefs::kWebKitSerifFontFamily, |
| 395 IDS_SERIF_FONT_FAMILY, | 434 IDS_SERIF_FONT_FAMILY, |
| 396 PrefService::UNSYNCABLE_PREF); | 435 PrefService::UNSYNCABLE_PREF); |
| 397 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalSansSerifFontFamily, | 436 prefs->RegisterLocalizedStringPref(prefs::kWebKitSansSerifFontFamily, |
| 398 IDS_SANS_SERIF_FONT_FAMILY, | 437 IDS_SANS_SERIF_FONT_FAMILY, |
| 399 PrefService::UNSYNCABLE_PREF); | 438 PrefService::UNSYNCABLE_PREF); |
| 400 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalCursiveFontFamily, | 439 prefs->RegisterLocalizedStringPref(prefs::kWebKitCursiveFontFamily, |
| 401 IDS_CURSIVE_FONT_FAMILY, | 440 IDS_CURSIVE_FONT_FAMILY, |
| 402 PrefService::UNSYNCABLE_PREF); | 441 PrefService::UNSYNCABLE_PREF); |
| 403 prefs->RegisterLocalizedStringPref(prefs::kWebKitGlobalFantasyFontFamily, | 442 prefs->RegisterLocalizedStringPref(prefs::kWebKitFantasyFontFamily, |
| 404 IDS_FANTASY_FONT_FAMILY, | 443 IDS_FANTASY_FONT_FAMILY, |
| 405 PrefService::UNSYNCABLE_PREF); | 444 PrefService::UNSYNCABLE_PREF); |
| 406 | 445 |
| 407 // Register per-script font prefs that have defaults. | 446 // Register per-script font prefs that have defaults. |
| 408 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN) | 447 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) || defined(OS_WIN) |
| 409 // As explained by its definition, kPerScriptFontDefaultsLength is only | 448 // As explained by its definition, kPerScriptFontDefaultsLength is only |
| 410 // defined for platforms where it would be non-zero. | 449 // defined for platforms where it would be non-zero. |
| 411 std::string locale = g_browser_process->GetApplicationLocale(); | 450 std::string locale = g_browser_process->GetApplicationLocale(); |
| 412 for (size_t i = 0; i < kPerScriptFontDefaultsLength; ++i) { | 451 for (size_t i = 0; i < kPerScriptFontDefaultsLength; ++i) { |
| 413 const PerScriptFontDefault& pref = kPerScriptFontDefaults[i]; | 452 const PerScriptFontDefault& pref = kPerScriptFontDefaults[i]; |
| 414 // Suppress default per-script font when the script matches the browser's | 453 // Suppress default per-script font when the script matches the browser's |
| 415 // locale. Otherwise, the default would override the user's preferences | 454 // locale. Otherwise, the default would override the user's preferences |
| 416 // when viewing pages in their native language. This can be removed when | 455 // when viewing pages in their native language. This would be bad |
| 417 // per-script fonts are added to Preferences UI. | 456 // particularly because there is not yet a way for users to customize |
| 457 // their per-script font prefs. This code can possibly be removed later if |
| 458 // users can easily access per-script font prefs (e.g., via the extensions |
| 459 // workflow), or the problem turns out to not be really critical after all. |
| 418 if (!StartsWithASCII(locale, pref.native_locale, false)) { | 460 if (!StartsWithASCII(locale, pref.native_locale, false)) { |
| 419 prefs->RegisterLocalizedStringPref(pref.pref_name, | 461 prefs->RegisterLocalizedStringPref(pref.pref_name, |
| 420 pref.resource_id, | 462 pref.resource_id, |
| 421 PrefService::UNSYNCABLE_PREF); | 463 PrefService::UNSYNCABLE_PREF); |
| 422 } | 464 } |
| 423 } | 465 } |
| 424 #endif | 466 #endif |
| 425 | 467 |
| 426 // Register the rest of the per-script font prefs. | 468 // Register the rest of the per-script font prefs. |
| 427 RegisterFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap); | 469 RegisterFontFamilyMap(prefs, prefs::kWebKitStandardFontFamilyMap); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 541 |
| 500 void PrefsTabHelper::UpdateRendererPreferences() { | 542 void PrefsTabHelper::UpdateRendererPreferences() { |
| 501 renderer_preferences_util::UpdateFromSystemSettings( | 543 renderer_preferences_util::UpdateFromSystemSettings( |
| 502 web_contents_->GetMutableRendererPrefs(), GetProfile()); | 544 web_contents_->GetMutableRendererPrefs(), GetProfile()); |
| 503 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); | 545 web_contents_->GetRenderViewHost()->SyncRendererPrefs(); |
| 504 } | 546 } |
| 505 | 547 |
| 506 Profile* PrefsTabHelper::GetProfile() { | 548 Profile* PrefsTabHelper::GetProfile() { |
| 507 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 549 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 508 } | 550 } |
| OLD | NEW |