| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 395 |
| 396 if (!has_permission) { | 396 if (!has_permission) { |
| 397 tab_info->Remove(keys::kUrlKey, NULL); | 397 tab_info->Remove(keys::kUrlKey, NULL); |
| 398 tab_info->Remove(keys::kTitleKey, NULL); | 398 tab_info->Remove(keys::kTitleKey, NULL); |
| 399 tab_info->Remove(keys::kFaviconUrlKey, NULL); | 399 tab_info->Remove(keys::kFaviconUrlKey, NULL); |
| 400 } | 400 } |
| 401 } | 401 } |
| 402 | 402 |
| 403 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, | 403 void ExtensionTabUtil::ScrubTabForExtension(const Extension* extension, |
| 404 api::tabs::Tab* tab) { | 404 api::tabs::Tab* tab) { |
| 405 bool has_permission = extension && extension->HasAPIPermission( | 405 bool has_permission = |
| 406 APIPermission::kTab); | 406 extension && |
| 407 extension->permissions_data()->HasAPIPermission(APIPermission::kTab); |
| 407 | 408 |
| 408 if (!has_permission) { | 409 if (!has_permission) { |
| 409 tab->url.reset(); | 410 tab->url.reset(); |
| 410 tab->title.reset(); | 411 tab->title.reset(); |
| 411 tab->fav_icon_url.reset(); | 412 tab->fav_icon_url.reset(); |
| 412 } | 413 } |
| 413 } | 414 } |
| 414 | 415 |
| 415 bool ExtensionTabUtil::GetTabStripModel(const WebContents* web_contents, | 416 bool ExtensionTabUtil::GetTabStripModel(const WebContents* web_contents, |
| 416 TabStripModel** tab_strip_model, | 417 TabStripModel** tab_strip_model, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 content::PAGE_TRANSITION_LINK, | 571 content::PAGE_TRANSITION_LINK, |
| 571 false); | 572 false); |
| 572 browser->OpenURL(params); | 573 browser->OpenURL(params); |
| 573 browser->window()->Show(); | 574 browser->window()->Show(); |
| 574 WebContents* web_contents = | 575 WebContents* web_contents = |
| 575 browser->tab_strip_model()->GetActiveWebContents(); | 576 browser->tab_strip_model()->GetActiveWebContents(); |
| 576 web_contents->GetDelegate()->ActivateContents(web_contents); | 577 web_contents->GetDelegate()->ActivateContents(web_contents); |
| 577 } | 578 } |
| 578 | 579 |
| 579 } // namespace extensions | 580 } // namespace extensions |
| OLD | NEW |