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(&web_prefs, extension); | 552 extension_webkit_preferences::SetPreferences( |
| 553 extension, rvh->delegate()->GetRenderViewType(), &web_prefs); |
553 } | 554 } |
554 | 555 |
555 if (rvh->delegate()->GetRenderViewType() == chrome::VIEW_TYPE_NOTIFICATION) { | 556 if (rvh->delegate()->GetRenderViewType() == chrome::VIEW_TYPE_NOTIFICATION) { |
556 web_prefs.allow_scripts_to_close_windows = true; | 557 web_prefs.allow_scripts_to_close_windows = true; |
557 } else if (rvh->delegate()->GetRenderViewType() == | 558 } else if (rvh->delegate()->GetRenderViewType() == |
558 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { | 559 chrome::VIEW_TYPE_BACKGROUND_CONTENTS) { |
559 // Disable all kinds of acceleration for background pages. | 560 // Disable all kinds of acceleration for background pages. |
560 // See http://crbug.com/96005 and http://crbug.com/96006 | 561 // See http://crbug.com/96005 and http://crbug.com/96006 |
561 web_prefs.force_compositing_mode = false; | 562 web_prefs.force_compositing_mode = false; |
562 web_prefs.accelerated_compositing_enabled = false; | 563 web_prefs.accelerated_compositing_enabled = false; |
(...skipping 16 matching lines...) Expand all Loading... |
579 DictionaryValue* inspector_settings = update.Get(); | 580 DictionaryValue* inspector_settings = update.Get(); |
580 inspector_settings->SetWithoutPathExpansion(key, | 581 inspector_settings->SetWithoutPathExpansion(key, |
581 Value::CreateStringValue(value)); | 582 Value::CreateStringValue(value)); |
582 } | 583 } |
583 | 584 |
584 void RenderViewHostDelegateHelper::ClearInspectorSettings( | 585 void RenderViewHostDelegateHelper::ClearInspectorSettings( |
585 content::BrowserContext* browser_context) { | 586 content::BrowserContext* browser_context) { |
586 Profile::FromBrowserContext(browser_context)->GetPrefs()-> | 587 Profile::FromBrowserContext(browser_context)->GetPrefs()-> |
587 ClearPref(prefs::kWebKitInspectorSettings); | 588 ClearPref(prefs::kWebKitInspectorSettings); |
588 } | 589 } |
OLD | NEW |