| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_tab_util.h" | 9 #include "chrome/browser/extensions/extension_tab_util.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 void ExtensionContextMenuModel::ExecuteCommand(int command_id) { | 106 void ExtensionContextMenuModel::ExecuteCommand(int command_id) { |
| 107 const Extension* extension = GetExtension(); | 107 const Extension* extension = GetExtension(); |
| 108 if (!extension) | 108 if (!extension) |
| 109 return; | 109 return; |
| 110 | 110 |
| 111 switch (command_id) { | 111 switch (command_id) { |
| 112 case NAME: { | 112 case NAME: { |
| 113 browser_->OpenURL(extension->GetHomepageURL(), GURL(), | 113 browser_->OpenURL(extension->GetHomepageURL(), GURL(), |
| 114 NEW_FOREGROUND_TAB, PageTransition::LINK); | 114 NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
| 115 break; | 115 break; |
| 116 } | 116 } |
| 117 case CONFIGURE: | 117 case CONFIGURE: |
| 118 DCHECK(!extension->options_url().is_empty()); | 118 DCHECK(!extension->options_url().is_empty()); |
| 119 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, | 119 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, |
| 120 browser_); | 120 browser_); |
| 121 break; | 121 break; |
| 122 case HIDE: { | 122 case HIDE: { |
| 123 ExtensionService* extension_service = profile_->GetExtensionService(); | 123 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 124 extension_service->SetBrowserActionVisibility(extension, false); | 124 extension_service->SetBrowserActionVisibility(extension, false); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { | 161 void ExtensionContextMenuModel::ExtensionUninstallCanceled() { |
| 162 Release(); | 162 Release(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 const Extension* ExtensionContextMenuModel::GetExtension() const { | 165 const Extension* ExtensionContextMenuModel::GetExtension() const { |
| 166 ExtensionService* extension_service = profile_->GetExtensionService(); | 166 ExtensionService* extension_service = profile_->GetExtensionService(); |
| 167 return extension_service->GetExtensionById(extension_id_, false); | 167 return extension_service->GetExtensionById(extension_id_, false); |
| 168 } | 168 } |
| OLD | NEW |