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

Side by Side Diff: chrome/browser/tab_contents/render_view_host_delegate_helper.cc

Issue 7693019: Enable smooth scrolling on mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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) 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
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 defined(OS_MACOSX)
474 if (command_line.HasSwitch(switches::kDisableMacSmoothScrollingForTesting))
475 web_prefs.enable_scroll_animator = false;
476 #endif
465 477
466 // The user stylesheet watcher may not exist in a testing profile. 478 // The user stylesheet watcher may not exist in a testing profile.
467 if (profile->GetUserStyleSheetWatcher()) { 479 if (profile->GetUserStyleSheetWatcher()) {
468 web_prefs.user_style_sheet_enabled = true; 480 web_prefs.user_style_sheet_enabled = true;
469 web_prefs.user_style_sheet_location = 481 web_prefs.user_style_sheet_location =
470 profile->GetUserStyleSheetWatcher()->user_style_sheet(); 482 profile->GetUserStyleSheetWatcher()->user_style_sheet();
471 } else { 483 } else {
472 web_prefs.user_style_sheet_enabled = false; 484 web_prefs.user_style_sheet_enabled = false;
473 } 485 }
474 } 486 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 DictionaryValue* inspector_settings = update.Get(); 534 DictionaryValue* inspector_settings = update.Get();
523 inspector_settings->SetWithoutPathExpansion(key, 535 inspector_settings->SetWithoutPathExpansion(key,
524 Value::CreateStringValue(value)); 536 Value::CreateStringValue(value));
525 } 537 }
526 538
527 void RenderViewHostDelegateHelper::ClearInspectorSettings( 539 void RenderViewHostDelegateHelper::ClearInspectorSettings(
528 content::BrowserContext* browser_context) { 540 content::BrowserContext* browser_context) {
529 Profile::FromBrowserContext(browser_context)->GetPrefs()-> 541 Profile::FromBrowserContext(browser_context)->GetPrefs()->
530 ClearPref(prefs::kWebKitInspectorSettings); 542 ClearPref(prefs::kWebKitInspectorSettings);
531 } 543 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698