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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 web_prefs.memory_info_enabled = | 453 web_prefs.memory_info_enabled = |
454 command_line.HasSwitch(switches::kEnableMemoryInfo); | 454 command_line.HasSwitch(switches::kEnableMemoryInfo); |
455 web_prefs.interactive_form_validation_enabled = | 455 web_prefs.interactive_form_validation_enabled = |
456 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation); | 456 !command_line.HasSwitch(switches::kDisableInteractiveFormValidation); |
457 web_prefs.fullscreen_enabled = | 457 web_prefs.fullscreen_enabled = |
458 command_line.HasSwitch(switches::kEnableFullScreen); | 458 command_line.HasSwitch(switches::kEnableFullScreen); |
459 web_prefs.allow_displaying_insecure_content = | 459 web_prefs.allow_displaying_insecure_content = |
460 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent); | 460 prefs->GetBoolean(prefs::kWebKitAllowDisplayingInsecureContent); |
461 web_prefs.allow_running_insecure_content = | 461 web_prefs.allow_running_insecure_content = |
462 prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent); | 462 prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent); |
463 web_prefs.enable_scroll_animator = | 463 |
464 command_line.HasSwitch(switches::kEnableSmoothScrolling); | 464 #if defined(OS_MACOSX) |
| 465 bool default_enable_scroll_animator = true; |
| 466 #else |
| 467 // On CrOS, the launcher always passes in the --enable flag. |
| 468 bool default_enable_scroll_animator = false; |
| 469 #endif |
| 470 web_prefs.enable_scroll_animator = default_enable_scroll_animator; |
| 471 if (command_line.HasSwitch(switches::kEnableSmoothScrolling)) |
| 472 web_prefs.enable_scroll_animator = true; |
| 473 if (command_line.HasSwitch(switches::kDisableSmoothScrolling)) |
| 474 web_prefs.enable_scroll_animator = false; |
465 | 475 |
466 // The user stylesheet watcher may not exist in a testing profile. | 476 // The user stylesheet watcher may not exist in a testing profile. |
467 if (profile->GetUserStyleSheetWatcher()) { | 477 if (profile->GetUserStyleSheetWatcher()) { |
468 web_prefs.user_style_sheet_enabled = true; | 478 web_prefs.user_style_sheet_enabled = true; |
469 web_prefs.user_style_sheet_location = | 479 web_prefs.user_style_sheet_location = |
470 profile->GetUserStyleSheetWatcher()->user_style_sheet(); | 480 profile->GetUserStyleSheetWatcher()->user_style_sheet(); |
471 } else { | 481 } else { |
472 web_prefs.user_style_sheet_enabled = false; | 482 web_prefs.user_style_sheet_enabled = false; |
473 } | 483 } |
474 } | 484 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 DictionaryValue* inspector_settings = update.Get(); | 532 DictionaryValue* inspector_settings = update.Get(); |
523 inspector_settings->SetWithoutPathExpansion(key, | 533 inspector_settings->SetWithoutPathExpansion(key, |
524 Value::CreateStringValue(value)); | 534 Value::CreateStringValue(value)); |
525 } | 535 } |
526 | 536 |
527 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 537 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
528 content::BrowserContext* browser_context) { | 538 content::BrowserContext* browser_context) { |
529 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 539 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
530 ClearPref(prefs::kWebKitInspectorSettings); | 540 ClearPref(prefs::kWebKitInspectorSettings); |
531 } | 541 } |
OLD | NEW |