diff options
-rw-r--r-- | chrome/browser/cocoa/extensions/browser_actions_controller.mm | 12 | ||||
-rw-r--r-- | chrome/browser/extensions/browser_action_apitest.cc | 5 |
2 files changed, 5 insertions, 12 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/cocoa/extensions/browser_actions_controller.mm index d6582c3..8d9afcc 100644 --- a/chrome/browser/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/cocoa/extensions/browser_actions_controller.mm @@ -816,13 +816,11 @@ class ExtensionsServiceObserverBridge : public NotificationObserver, #pragma mark Testing Methods - (NSButton*)buttonWithIndex:(NSUInteger)index { - NSUInteger i = 0; - for (ExtensionList::iterator iter = toolbarModel_->begin(); - iter != toolbarModel_->end(); ++iter) { - if (i == index) - return [buttons_ objectForKey:base::SysUTF8ToNSString((*iter)->id())]; - - ++i; + if (profile_->IsOffTheRecord()) + index = toolbarModel_->IncognitoIndexToOriginal(index); + if (index < toolbarModel_->size()) { + Extension* extension = toolbarModel_->GetExtensionByIndex(index); + return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; } return nil; } diff --git a/chrome/browser/extensions/browser_action_apitest.cc b/chrome/browser/extensions/browser_action_apitest.cc index dbdf6c9..7bae10d 100644 --- a/chrome/browser/extensions/browser_action_apitest.cc +++ b/chrome/browser/extensions/browser_action_apitest.cc @@ -306,12 +306,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, MAYBE_IncognitoBasic) { // incognito. } -// TODO(mpcomplete): enable this when Mac gets dragging support. -#if defined(OS_MACOSX) -IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DISABLED_IncognitoDragging) { -#else IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, IncognitoDragging) { -#endif ExtensionsService* service = browser()->profile()->GetExtensionsService(); // The tooltips for each respective browser action. |