| Index: chrome/browser/tab_contents/menu_category_platform_app.cc
|
| diff --git a/chrome/browser/tab_contents/menu_category_platform_app.cc b/chrome/browser/tab_contents/menu_category_platform_app.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..910a1d7f68febdcfdebc43d2c093b28d77157436
|
| --- /dev/null
|
| +++ b/chrome/browser/tab_contents/menu_category_platform_app.cc
|
| @@ -0,0 +1,36 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/tab_contents/menu_category_platform_app.h"
|
| +
|
| +#include "base/command_line.h"
|
| +#include "chrome/common/chrome_switches.h"
|
| +#include "extensions/common/extension.h"
|
| +#include "extensions/common/manifest.h"
|
| +
|
| +MenuCategoryPlatformApp::MenuCategoryPlatformApp(
|
| + content::RenderFrameHost* render_frame_host,
|
| + const content::ContextMenuParams& params)
|
| + : MenuCategoryBase(render_frame_host, params) {
|
| +}
|
| +
|
| +MenuCategoryPlatformApp::~MenuCategoryPlatformApp() {
|
| +}
|
| +
|
| +bool MenuCategoryPlatformApp::IsCategoryEnabled(int category) {
|
| + switch (category) {
|
| + case ITEM_CATEGORY_EDITABLE:
|
| + case ITEM_CATEGORY_COPY:
|
| + return MenuCategoryBase::IsCategoryEnabled(category);
|
| + case ITEM_CATEGORY_CURRENT_EXTENSION:
|
| + return true;
|
| + case ITEM_CATEGORY_DEVTOOLS_UNPACKED_EXT:
|
| + return extensions::Manifest::IsUnpackedLocation(
|
| + GetExtension()->location()) ||
|
| + CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kDebugPackedApps);
|
| + default:
|
| + return false;
|
| + }
|
| +}
|
|
|