This source file includes following definitions.
- SupportsGroup
#include "chrome/browser/renderer_context_menu/context_menu_content_type_platform_app.h"
#include "base/command_line.h"
#include "chrome/common/chrome_switches.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
ContextMenuContentTypePlatformApp::ContextMenuContentTypePlatformApp(
content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params)
: ContextMenuContentType(render_frame_host, params, false) {
}
ContextMenuContentTypePlatformApp::~ContextMenuContentTypePlatformApp() {
}
bool ContextMenuContentTypePlatformApp::SupportsGroup(int group) {
const extensions::Extension* platform_app = GetExtension();
if (!platform_app)
return false;
DCHECK(platform_app->is_platform_app());
switch (group) {
case ITEM_GROUP_EDITABLE:
case ITEM_GROUP_COPY:
return ContextMenuContentType::SupportsGroup(group);
case ITEM_GROUP_CURRENT_EXTENSION:
return true;
case ITEM_GROUP_DEVTOOLS_UNPACKED_EXT:
return extensions::Manifest::IsUnpackedLocation(
platform_app->location()) ||
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDebugPackedApps);
default:
return false;
}
}