| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_tab_util.h" | 5 #include "chrome/browser/extensions/extension_tab_util.h" |
| 6 | 6 |
| 7 #include "apps/app_window.h" | 7 #include "apps/app_window.h" |
| 8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 | 384 |
| 385 return result; | 385 return result; |
| 386 } | 386 } |
| 387 | 387 |
| 388 void ExtensionTabUtil::ScrubTabValueForExtension( | 388 void ExtensionTabUtil::ScrubTabValueForExtension( |
| 389 WebContents* contents, | 389 WebContents* contents, |
| 390 const Extension* extension, | 390 const Extension* extension, |
| 391 base::DictionaryValue* tab_info) { | 391 base::DictionaryValue* tab_info) { |
| 392 bool has_permission = | 392 bool has_permission = |
| 393 extension && | 393 extension && |
| 394 PermissionsData::HasAPIPermissionForTab( | 394 PermissionsData::ForExtension(extension) |
| 395 extension, GetTabId(contents), APIPermission::kTab); | 395 ->HasAPIPermissionForTab(GetTabId(contents), APIPermission::kTab); |
| 396 | 396 |
| 397 if (!has_permission) { | 397 if (!has_permission) { |
| 398 tab_info->Remove(keys::kUrlKey, NULL); | 398 tab_info->Remove(keys::kUrlKey, NULL); |
| 399 tab_info->Remove(keys::kTitleKey, NULL); | 399 tab_info->Remove(keys::kTitleKey, NULL); |
| 400 tab_info->Remove(keys::kFaviconUrlKey, NULL); | 400 tab_info->Remove(keys::kFaviconUrlKey, NULL); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, | 404 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, |
| 405 api::tabs::Tab* tab) { | 405 api::tabs::Tab* tab) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 content::PAGE_TRANSITION_LINK, | 571 content::PAGE_TRANSITION_LINK, |
| 572 false); | 572 false); |
| 573 browser->OpenURL(params); | 573 browser->OpenURL(params); |
| 574 browser->window()->Show(); | 574 browser->window()->Show(); |
| 575 WebContents* web_contents = | 575 WebContents* web_contents = |
| 576 browser->tab_strip_model()->GetActiveWebContents(); | 576 browser->tab_strip_model()->GetActiveWebContents(); |
| 577 web_contents->GetDelegate()->ActivateContents(web_contents); | 577 web_contents->GetDelegate()->ActivateContents(web_contents); |
| 578 } | 578 } |
| 579 | 579 |
| 580 } // namespace extensions | 580 } // namespace extensions |
| OLD | NEW |