OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 return is_app() && display_in_new_tab_page_; | 522 return is_app() && display_in_new_tab_page_; |
523 } | 523 } |
524 | 524 |
525 bool Extension::ShouldDisplayInExtensionSettings() const { | 525 bool Extension::ShouldDisplayInExtensionSettings() const { |
526 // Don't show for themes since the settings UI isn't really useful for them. | 526 // Don't show for themes since the settings UI isn't really useful for them. |
527 if (is_theme()) | 527 if (is_theme()) |
528 return false; | 528 return false; |
529 | 529 |
530 // Don't show component extensions because they are only extensions as an | 530 // Don't show component extensions because they are only extensions as an |
531 // implementation detail of Chrome. | 531 // implementation detail of Chrome. |
| 532 |
532 if (location() == Manifest::COMPONENT && | 533 if (location() == Manifest::COMPONENT && |
533 !CommandLine::ForCurrentProcess()->HasSwitch( | 534 !CommandLine::ForCurrentProcess()->HasSwitch( |
534 switches::kShowComponentExtensionOptions)) { | 535 switches::kShowComponentExtensionOptions)) { |
535 return false; | 536 return false; |
536 } | 537 } |
537 | 538 |
| 539 // Don't show apps that aren't visible in either launcher or ntp. |
| 540 if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage()) |
| 541 return false; |
| 542 |
538 // Always show unpacked extensions and apps. | 543 // Always show unpacked extensions and apps. |
539 if (Manifest::IsUnpackedLocation(location())) | 544 if (Manifest::IsUnpackedLocation(location())) |
540 return true; | 545 return true; |
541 | 546 |
542 // Unless they are unpacked, never show hosted apps. Note: We intentionally | 547 // Unless they are unpacked, never show hosted apps. Note: We intentionally |
543 // show packaged apps and platform apps because there are some pieces of | 548 // show packaged apps and platform apps because there are some pieces of |
544 // functionality that are only available in chrome://extensions/ but which | 549 // functionality that are only available in chrome://extensions/ but which |
545 // are needed for packaged and platform apps. For example, inspecting | 550 // are needed for packaged and platform apps. For example, inspecting |
546 // background pages. See http://crbug.com/116134. | 551 // background pages. See http://crbug.com/116134. |
547 if (is_hosted_app()) | 552 if (is_hosted_app()) |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1239 | 1244 |
1240 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 1245 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
1241 const Extension* extension, | 1246 const Extension* extension, |
1242 const PermissionSet* permissions, | 1247 const PermissionSet* permissions, |
1243 Reason reason) | 1248 Reason reason) |
1244 : reason(reason), | 1249 : reason(reason), |
1245 extension(extension), | 1250 extension(extension), |
1246 permissions(permissions) {} | 1251 permissions(permissions) {} |
1247 | 1252 |
1248 } // namespace extensions | 1253 } // namespace extensions |
OLD | NEW |