| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 web_prefs.loads_images_automatically = true; | 542 web_prefs.loads_images_automatically = true; |
| 543 web_prefs.javascript_enabled = true; | 543 web_prefs.javascript_enabled = true; |
| 544 } | 544 } |
| 545 | 545 |
| 546 web_prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); | 546 web_prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); |
| 547 | 547 |
| 548 ExtensionService* service = profile->GetExtensionService(); | 548 ExtensionService* service = profile->GetExtensionService(); |
| 549 if (service) { | 549 if (service) { |
| 550 const Extension* extension = | 550 const Extension* extension = |
| 551 service->GetExtensionByURL(rvh->site_instance()->site()); | 551 service->GetExtensionByURL(rvh->site_instance()->site()); |
| 552 extension_webkit_preferences::SetPreferences( | 552 extension_webkit_preferences::SetPreferences(&web_prefs, extension); |
| 553 extension, rvh->delegate()->GetRenderViewType(), &web_prefs); | |
| 554 } | 553 } |
| 555 | 554 |
| 556 if (rvh->delegate()->GetRenderViewType() == chrome::VIEW_TYPE_NOTIFICATION) { | 555 if (rvh->delegate()->GetRenderViewType() == chrome::VIEW_TYPE_NOTIFICATION) { |
| 557 web_prefs.allow_scripts_to_close_windows = true; | 556 web_prefs.allow_scripts_to_close_windows = true; |
| 558 } else if (rvh->delegate()->GetRenderViewType() == | 557 } else if (rvh->delegate()->GetRenderViewType() == |
| 559 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { | 558 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { |
| 560 // Disable all kinds of acceleration for background pages. | 559 // Disable all kinds of acceleration for background pages. |
| 561 // See http://crbug.com/96005 and http://crbug.com/96006 | 560 // See http://crbug.com/96005 and http://crbug.com/96006 |
| 562 web_prefs.force_compositing_mode = false; | 561 web_prefs.force_compositing_mode = false; |
| 563 web_prefs.accelerated_compositing_enabled = false; | 562 web_prefs.accelerated_compositing_enabled = false; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 580 DictionaryValue* inspector_settings = update.Get(); | 579 DictionaryValue* inspector_settings = update.Get(); |
| 581 inspector_settings->SetWithoutPathExpansion(key, | 580 inspector_settings->SetWithoutPathExpansion(key, |
| 582 Value::CreateStringValue(value)); | 581 Value::CreateStringValue(value)); |
| 583 } | 582 } |
| 584 | 583 |
| 585 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 584 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
| 586 content::BrowserContext* browser_context) { | 585 content::BrowserContext* browser_context) { |
| 587 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 586 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
| 588 ClearPref(prefs::kWebKitInspectorSettings); | 587 ClearPref(prefs::kWebKitInspectorSettings); |
| 589 } | 588 } |
| OLD | NEW |