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/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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 browser_->OpenURL(params); | 87 browser_->OpenURL(params); |
88 break; | 88 break; |
89 } | 89 } |
90 case CONFIGURE: | 90 case CONFIGURE: |
91 DCHECK(!extension->options_url().is_empty()); | 91 DCHECK(!extension->options_url().is_empty()); |
92 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, | 92 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, |
93 browser_); | 93 browser_); |
94 break; | 94 break; |
95 case HIDE: { | 95 case HIDE: { |
96 ExtensionService* extension_service = profile_->GetExtensionService(); | 96 ExtensionService* extension_service = profile_->GetExtensionService(); |
97 extension_service->SetBrowserActionVisibility(extension, false); | 97 extension_service->extension_prefs()-> |
| 98 SetBrowserActionVisibility(extension, false); |
98 break; | 99 break; |
99 } | 100 } |
100 case DISABLE: { | 101 case DISABLE: { |
101 ExtensionService* extension_service = profile_->GetExtensionService(); | 102 ExtensionService* extension_service = profile_->GetExtensionService(); |
102 extension_service->DisableExtension(extension_id_, | 103 extension_service->DisableExtension(extension_id_, |
103 Extension::DISABLE_USER_ACTION); | 104 Extension::DISABLE_USER_ACTION); |
104 break; | 105 break; |
105 } | 106 } |
106 case UNINSTALL: { | 107 case UNINSTALL: { |
107 AddRef(); // Balanced in Accepted() and Canceled() | 108 AddRef(); // Balanced in Accepted() and Canceled() |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (extension->browser_action()) | 150 if (extension->browser_action()) |
150 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); | 151 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); |
151 AddSeparator(); | 152 AddSeparator(); |
152 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); | 153 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); |
153 } | 154 } |
154 | 155 |
155 const Extension* ExtensionContextMenuModel::GetExtension() const { | 156 const Extension* ExtensionContextMenuModel::GetExtension() const { |
156 ExtensionService* extension_service = profile_->GetExtensionService(); | 157 ExtensionService* extension_service = profile_->GetExtensionService(); |
157 return extension_service->GetExtensionById(extension_id_, false); | 158 return extension_service->GetExtensionById(extension_id_, false); |
158 } | 159 } |
OLD | NEW |