| 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 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h" |
| 6 | 6 |
| 7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
| 8 #include "base/task.h" | 8 #include "base/task.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_tab_util.h" | 10 #include "chrome/browser/extensions/extension_tab_util.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 - (void)dispatch:(id)menuItem { | 233 - (void)dispatch:(id)menuItem { |
| 234 Browser* browser = BrowserList::FindBrowserWithProfile(profile_); | 234 Browser* browser = BrowserList::FindBrowserWithProfile(profile_); |
| 235 if (!browser) | 235 if (!browser) |
| 236 return; | 236 return; |
| 237 | 237 |
| 238 NSMenuItem* item = (NSMenuItem*)menuItem; | 238 NSMenuItem* item = (NSMenuItem*)menuItem; |
| 239 switch ([item tag]) { | 239 switch ([item tag]) { |
| 240 case kExtensionContextName: { | 240 case kExtensionContextName: { |
| 241 GURL url(std::string(extension_urls::kGalleryBrowsePrefix) + | 241 GURL url(std::string(extension_urls::kGalleryBrowsePrefix) + |
| 242 std::string("/detail/") + extension_->id()); | 242 std::string("/detail/") + extension_->id()); |
| 243 browser->OpenURL(url, GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | 243 browser->OpenURL( |
| 244 url, GURL(), NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK); |
| 244 break; | 245 break; |
| 245 } | 246 } |
| 246 case kExtensionContextOptions: { | 247 case kExtensionContextOptions: { |
| 247 DCHECK(!extension_->options_url().is_empty()); | 248 DCHECK(!extension_->options_url().is_empty()); |
| 248 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, | 249 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension_, |
| 249 browser); | 250 browser); |
| 250 break; | 251 break; |
| 251 } | 252 } |
| 252 case kExtensionContextDisable: { | 253 case kExtensionContextDisable: { |
| 253 ExtensionService* extensionService = profile_->GetExtensionService(); | 254 ExtensionService* extensionService = profile_->GetExtensionService(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 317 } |
| 317 return YES; | 318 return YES; |
| 318 } | 319 } |
| 319 | 320 |
| 320 - (void)invalidateProfile { | 321 - (void)invalidateProfile { |
| 321 observer_.reset(); | 322 observer_.reset(); |
| 322 profile_ = NULL; | 323 profile_ = NULL; |
| 323 } | 324 } |
| 324 | 325 |
| 325 @end | 326 @end |
| OLD | NEW |