Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1705)

Unified Diff: chrome/browser/context_menu/context_menu_content_type_platform_app.cc

Issue 169093009: Separate out logic to handle different category/group of context menu items from RVContextMenu class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@work-mmm-refactor1
Patch Set: Forgot to add context_menu_content_type_webview.* Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/context_menu/context_menu_content_type_platform_app.cc
diff --git a/chrome/browser/context_menu/context_menu_content_type_platform_app.cc b/chrome/browser/context_menu/context_menu_content_type_platform_app.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d5be66126c06edeb6b4baa41587d6149ee7d7919
--- /dev/null
+++ b/chrome/browser/context_menu/context_menu_content_type_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/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) {
+}
+
+ContextMenuContentTypePlatformApp::~ContextMenuContentTypePlatformApp() {
+}
+
+bool ContextMenuContentTypePlatformApp::SupportsGroup(int group) {
+ 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(
+ GetExtension()->location()) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDebugPackedApps);
+ default:
+ return false;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698