| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro
ller.h" |
| 6 | 6 |
| 7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
| 8 #include "chrome/browser/extensions/active_script_controller.h" | 8 #include "chrome/browser/extensions/active_script_controller.h" |
| 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 10 #include "chrome/browser/extensions/extension_action_manager.h" | 10 #include "chrome/browser/extensions/extension_action_manager.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 extension_).is_valid()]; | 113 extension_).is_valid()]; |
| 114 | 114 |
| 115 // Separator. | 115 // Separator. |
| 116 [menu addItem:[NSMenuItem separatorItem]]; | 116 [menu addItem:[NSMenuItem separatorItem]]; |
| 117 | 117 |
| 118 // Always Run. Only displayed if there is an active script injection action. | 118 // Always Run. Only displayed if there is an active script injection action. |
| 119 content::WebContents* activeTab = | 119 content::WebContents* activeTab = |
| 120 browser_->tab_strip_model()->GetActiveWebContents(); | 120 browser_->tab_strip_model()->GetActiveWebContents(); |
| 121 if (activeTab && | 121 if (activeTab && |
| 122 extensions::ActiveScriptController::GetForWebContents(activeTab) | 122 extensions::ActiveScriptController::GetForWebContents(activeTab) |
| 123 ->HasActiveScriptAction(extension_)) { | 123 ->WantsToRun(extension_)) { |
| 124 item = [menu addItemWithTitle: | 124 item = [menu addItemWithTitle: |
| 125 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_ALWAYS_RUN) | 125 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_ALWAYS_RUN) |
| 126 action:@selector(onAlwaysRun:) | 126 action:@selector(onAlwaysRun:) |
| 127 keyEquivalent:@""]; | 127 keyEquivalent:@""]; |
| 128 [item setTarget:self]; | 128 [item setTarget:self]; |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Options. | 131 // Options. |
| 132 item = [menu addItemWithTitle: | 132 item = [menu addItemWithTitle: |
| 133 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_OPTIONS_MENU_ITEM) | 133 l10n_util::GetNSStringWithFixup(IDS_EXTENSIONS_OPTIONS_MENU_ITEM) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 return; | 249 return; |
| 250 | 250 |
| 251 [ExtensionPopupController showURL:url | 251 [ExtensionPopupController showURL:url |
| 252 inBrowser:browser_ | 252 inBrowser:browser_ |
| 253 anchoredAt:popupPoint | 253 anchoredAt:popupPoint |
| 254 arrowLocation:info_bubble::kTopRight | 254 arrowLocation:info_bubble::kTopRight |
| 255 devMode:YES]; | 255 devMode:YES]; |
| 256 } | 256 } |
| 257 | 257 |
| 258 @end | 258 @end |
| OLD | NEW |