| 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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 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 ExtensionsService* extensions_service = profile->GetExtensionsService(); |
| 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()) | |
| 46 return NULL; | 45 return NULL; |
| 47 | 46 |
| 48 const Extension* extension = | 47 const Extension* extension = |
| 49 extensions_service->GetExtensionByURL(opener_url); | 48 extensions_service->GetExtensionByURL(opener_url); |
| 50 if (!extension) | 49 if (!extension) |
| 51 extension = extensions_service->GetExtensionByWebExtent(opener_url); | 50 extension = extensions_service->GetExtensionByWebExtent(opener_url); |
| 52 if (!extension || | 51 if (!extension || |
| 53 !extension->HasApiPermission(Extension::kBackgroundPermission)) | 52 !extension->HasApiPermission(Extension::kBackgroundPermission)) |
| 54 return NULL; | 53 return NULL; |
| 55 | 54 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 inspector_settings->SetWithoutPathExpansion(key, | 326 inspector_settings->SetWithoutPathExpansion(key, |
| 328 Value::CreateStringValue(value)); | 327 Value::CreateStringValue(value)); |
| 329 } | 328 } |
| 330 | 329 |
| 331 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { | 330 void RenderViewHostDelegateHelper::ClearInspectorSettings(Profile* profile) { |
| 332 DictionaryValue* inspector_settings = | 331 DictionaryValue* inspector_settings = |
| 333 profile->GetPrefs()->GetMutableDictionary( | 332 profile->GetPrefs()->GetMutableDictionary( |
| 334 prefs::kWebKitInspectorSettings); | 333 prefs::kWebKitInspectorSettings); |
| 335 inspector_settings->Clear(); | 334 inspector_settings->Clear(); |
| 336 } | 335 } |
| OLD | NEW |