| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/render_view_host_delegate_helper.h" | 5 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 if (profile->GetUserStyleSheetWatcher()) { | 498 if (profile->GetUserStyleSheetWatcher()) { |
| 499 web_prefs.user_style_sheet_enabled = true; | 499 web_prefs.user_style_sheet_enabled = true; |
| 500 web_prefs.user_style_sheet_location = | 500 web_prefs.user_style_sheet_location = |
| 501 profile->GetUserStyleSheetWatcher()->user_style_sheet(); | 501 profile->GetUserStyleSheetWatcher()->user_style_sheet(); |
| 502 } else { | 502 } else { |
| 503 web_prefs.user_style_sheet_enabled = false; | 503 web_prefs.user_style_sheet_enabled = false; |
| 504 } | 504 } |
| 505 | 505 |
| 506 web_prefs.visual_word_movement_enabled = | 506 web_prefs.visual_word_movement_enabled = |
| 507 command_line.HasSwitch(switches::kEnableVisualWordMovement); | 507 command_line.HasSwitch(switches::kEnableVisualWordMovement); |
| 508 |
| 509 web_prefs.unified_textchecker_enabled = |
| 510 command_line.HasSwitch(switches::kExperimentalSpellcheckerFeatures); |
| 508 } | 511 } |
| 509 | 512 |
| 510 { // Certain GPU features might have been blacklisted. | 513 { // Certain GPU features might have been blacklisted. |
| 511 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); | 514 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); |
| 512 DCHECK(gpu_data_manager); | 515 DCHECK(gpu_data_manager); |
| 513 uint32 blacklist_flags = gpu_data_manager->GetGpuFeatureFlags().flags(); | 516 uint32 blacklist_flags = gpu_data_manager->GetGpuFeatureFlags().flags(); |
| 514 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureAcceleratedCompositing) | 517 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureAcceleratedCompositing) |
| 515 web_prefs.accelerated_compositing_enabled = false; | 518 web_prefs.accelerated_compositing_enabled = false; |
| 516 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl) | 519 if (blacklist_flags & GpuFeatureFlags::kGpuFeatureWebgl) |
| 517 web_prefs.experimental_webgl_enabled = false; | 520 web_prefs.experimental_webgl_enabled = false; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 DictionaryValue* inspector_settings = update.Get(); | 584 DictionaryValue* inspector_settings = update.Get(); |
| 582 inspector_settings->SetWithoutPathExpansion(key, | 585 inspector_settings->SetWithoutPathExpansion(key, |
| 583 Value::CreateStringValue(value)); | 586 Value::CreateStringValue(value)); |
| 584 } | 587 } |
| 585 | 588 |
| 586 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 589 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
| 587 content::BrowserContext* browser_context) { | 590 content::BrowserContext* browser_context) { |
| 588 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 591 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
| 589 ClearPref(prefs::kWebKitInspectorSettings); | 592 ClearPref(prefs::kWebKitInspectorSettings); |
| 590 } | 593 } |
| OLD | NEW |