OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/extensions/context_menu_matcher.h" | 10 #include "chrome/browser/extensions/context_menu_matcher.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { | 237 command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) { |
238 DCHECK(extension_items_); | 238 DCHECK(extension_items_); |
239 extension_items_->ExecuteCommand(command_id, GetActiveWebContents(), | 239 extension_items_->ExecuteCommand(command_id, GetActiveWebContents(), |
240 nullptr, content::ContextMenuParams()); | 240 nullptr, content::ContextMenuParams()); |
241 return; | 241 return; |
242 } | 242 } |
243 | 243 |
244 switch (command_id) { | 244 switch (command_id) { |
245 case NAME: { | 245 case NAME: { |
246 content::OpenURLParams params(ManifestURL::GetHomepageURL(extension), | 246 content::OpenURLParams params(ManifestURL::GetHomepageURL(extension), |
247 content::Referrer(), NEW_FOREGROUND_TAB, | 247 content::Referrer(), |
| 248 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
248 ui::PAGE_TRANSITION_LINK, false); | 249 ui::PAGE_TRANSITION_LINK, false); |
249 browser_->OpenURL(params); | 250 browser_->OpenURL(params); |
250 break; | 251 break; |
251 } | 252 } |
252 case CONFIGURE: | 253 case CONFIGURE: |
253 DCHECK(OptionsPageInfo::HasOptionsPage(extension)); | 254 DCHECK(OptionsPageInfo::HasOptionsPage(extension)); |
254 ExtensionTabUtil::OpenOptionsPage(extension, browser_); | 255 ExtensionTabUtil::OpenOptionsPage(extension, browser_); |
255 break; | 256 break; |
256 case TOGGLE_VISIBILITY: { | 257 case TOGGLE_VISIBILITY: { |
257 bool currently_visible = button_visibility_ == VISIBLE; | 258 bool currently_visible = button_visibility_ == VISIBLE; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 if (runner && runner->WantsToRun(extension)) | 457 if (runner && runner->WantsToRun(extension)) |
457 runner->RunBlockedActions(extension); | 458 runner->RunBlockedActions(extension); |
458 } | 459 } |
459 } | 460 } |
460 | 461 |
461 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { | 462 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { |
462 return browser_->tab_strip_model()->GetActiveWebContents(); | 463 return browser_->tab_strip_model()->GetActiveWebContents(); |
463 } | 464 } |
464 | 465 |
465 } // namespace extensions | 466 } // namespace extensions |
OLD | NEW |