| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/background_contents_service.h" | 10 #include "chrome/browser/background_contents_service.h" |
| 11 #include "chrome/browser/character_encoding.h" | 11 #include "chrome/browser/character_encoding.h" |
| 12 #include "chrome/browser/extensions/extensions_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/renderer_host/render_view_host.h" | 15 #include "chrome/browser/renderer_host/render_view_host.h" |
| 16 #include "chrome/browser/renderer_host/render_process_host.h" | 16 #include "chrome/browser/renderer_host/render_process_host.h" |
| 17 #include "chrome/browser/renderer_host/render_widget_fullscreen_host.h" | 17 #include "chrome/browser/renderer_host/render_widget_fullscreen_host.h" |
| 18 #include "chrome/browser/renderer_host/render_widget_host.h" | 18 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 19 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 19 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 20 #include "chrome/browser/renderer_host/site_instance.h" | 20 #include "chrome/browser/renderer_host/site_instance.h" |
| 21 #include "chrome/browser/tab_contents/background_contents.h" | 21 #include "chrome/browser/tab_contents/background_contents.h" |
| 22 #include "chrome/browser/tab_contents/tab_contents.h" | 22 #include "chrome/browser/tab_contents/tab_contents.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents_view.h" | 23 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 24 #include "chrome/browser/user_style_sheet_watcher.h" | 24 #include "chrome/browser/user_style_sheet_watcher.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/notification_service.h" | 26 #include "chrome/common/notification_service.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 | 28 |
| 29 RenderViewHostDelegateViewHelper::RenderViewHostDelegateViewHelper() {} | 29 RenderViewHostDelegateViewHelper::RenderViewHostDelegateViewHelper() {} |
| 30 | 30 |
| 31 RenderViewHostDelegateViewHelper::~RenderViewHostDelegateViewHelper() {} | 31 RenderViewHostDelegateViewHelper::~RenderViewHostDelegateViewHelper() {} |
| 32 | 32 |
| 33 BackgroundContents* | 33 BackgroundContents* |
| 34 RenderViewHostDelegateViewHelper::MaybeCreateBackgroundContents( | 34 RenderViewHostDelegateViewHelper::MaybeCreateBackgroundContents( |
| 35 int route_id, | 35 int route_id, |
| 36 Profile* profile, | 36 Profile* profile, |
| 37 SiteInstance* site, | 37 SiteInstance* site, |
| 38 const GURL& opener_url, | 38 const GURL& opener_url, |
| 39 const string16& frame_name) { | 39 const string16& frame_name) { |
| 40 ExtensionsService* extensions_service = profile->GetExtensionsService(); | 40 ExtensionService* extensions_service = profile->GetExtensionService(); |
| 41 | 41 |
| 42 if (!opener_url.is_valid() || | 42 if (!opener_url.is_valid() || |
| 43 frame_name.empty() || | 43 frame_name.empty() || |
| 44 !extensions_service || | 44 !extensions_service || |
| 45 !extensions_service->is_ready()) | 45 !extensions_service->is_ready()) |
| 46 return NULL; | 46 return NULL; |
| 47 | 47 |
| 48 const Extension* extension = | 48 const Extension* extension = |
| 49 extensions_service->GetExtensionByURL(opener_url); | 49 extensions_service->GetExtensionByURL(opener_url); |
| 50 if (!extension) | 50 if (!extension) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 inspector_settings->SetWithoutPathExpansion(key, | 334 inspector_settings->SetWithoutPathExpansion(key, |
| 335 Value::CreateStringValue(value)); | 335 Value::CreateStringValue(value)); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { | 338 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { |
| 339 DictionaryValue* inspector_settings = | 339 DictionaryValue* inspector_settings = |
| 340 profile->GetPrefs()->GetMutableDictionary( | 340 profile->GetPrefs()->GetMutableDictionary( |
| 341 prefs::kWebKitInspectorSettings); | 341 prefs::kWebKitInspectorSettings); |
| 342 inspector_settings->Clear(); | 342 inspector_settings->Clear(); |
| 343 } | 343 } |
| OLD | NEW |