OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/guest_view/web_view/context_menu_content_type_web_view. h" | 5 #include "chrome/browser/guest_view/web_view/context_menu_content_type_web_view. h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
10 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 10 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
11 #include "extensions/browser/process_manager.h" | |
11 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
12 #include "extensions/common/manifest.h" | 13 #include "extensions/common/manifest.h" |
13 | 14 |
15 #if defined(ENABLE_EXTENSIONS) | |
Fady Samuel
2015/05/03 03:08:45
This (#if defined) is unnecessary. <webview>s are
Deepak
2015/05/04 04:10:10
Done.
| |
16 using extensions::Extension; | |
17 using extensions::ProcessManager; | |
18 #endif | |
19 | |
14 ContextMenuContentTypeWebView::ContextMenuContentTypeWebView( | 20 ContextMenuContentTypeWebView::ContextMenuContentTypeWebView( |
15 content::WebContents* web_contents, | 21 content::WebContents* web_contents, |
16 const content::ContextMenuParams& params) | 22 const content::ContextMenuParams& params) |
17 : ContextMenuContentType(web_contents, params, true) { | 23 : ContextMenuContentType(web_contents, params, true) { |
18 } | 24 } |
19 | 25 |
20 ContextMenuContentTypeWebView::~ContextMenuContentTypeWebView() { | 26 ContextMenuContentTypeWebView::~ContextMenuContentTypeWebView() { |
21 } | 27 } |
22 | 28 |
29 #if defined(ENABLE_EXTENSIONS) | |
Fady Samuel
2015/05/03 03:08:45
This (#if defined) is unnecessary. <webview>s are
Deepak
2015/05/04 04:10:10
Done.
| |
30 const Extension* ContextMenuContentTypeWebView::GetExtension() const { | |
31 ProcessManager* process_manager = | |
32 ProcessManager::Get(source_web_contents()->GetBrowserContext()); | |
33 return process_manager->GetExtensionForWebContents( | |
34 source_web_contents()); | |
35 } | |
36 #endif | |
37 | |
23 bool ContextMenuContentTypeWebView::SupportsGroup(int group) { | 38 bool ContextMenuContentTypeWebView::SupportsGroup(int group) { |
24 switch (group) { | 39 switch (group) { |
25 case ITEM_GROUP_PAGE: | 40 case ITEM_GROUP_PAGE: |
26 case ITEM_GROUP_FRAME: | 41 case ITEM_GROUP_FRAME: |
27 case ITEM_GROUP_LINK: | 42 case ITEM_GROUP_LINK: |
28 case ITEM_GROUP_SEARCHWEBFORIMAGE: | 43 case ITEM_GROUP_SEARCHWEBFORIMAGE: |
29 case ITEM_GROUP_SEARCH_PROVIDER: | 44 case ITEM_GROUP_SEARCH_PROVIDER: |
30 case ITEM_GROUP_PRINT: | 45 case ITEM_GROUP_PRINT: |
31 case ITEM_GROUP_ALL_EXTENSION: | 46 case ITEM_GROUP_ALL_EXTENSION: |
32 case ITEM_GROUP_PRINT_PREVIEW: | 47 case ITEM_GROUP_PRINT_PREVIEW: |
(...skipping 26 matching lines...) Expand all Loading... | |
59 base::CommandLine::ForCurrentProcess()->HasSwitch( | 74 base::CommandLine::ForCurrentProcess()->HasSwitch( |
60 switches::kDebugPackedApps); | 75 switches::kDebugPackedApps); |
61 #else | 76 #else |
62 return ContextMenuContentType::SupportsGroup(group); | 77 return ContextMenuContentType::SupportsGroup(group); |
63 #endif | 78 #endif |
64 } | 79 } |
65 default: | 80 default: |
66 return ContextMenuContentType::SupportsGroup(group); | 81 return ContextMenuContentType::SupportsGroup(group); |
67 } | 82 } |
68 } | 83 } |
OLD | NEW |