OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_contro
ller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro
ller.h" |
6 | 6 |
7 #include "base/strings/sys_string_conversions.h" | 7 #include "base/strings/sys_string_conversions.h" |
8 #include "chrome/browser/extensions/active_script_controller.h" | 8 #include "chrome/browser/extensions/active_script_controller.h" |
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
10 #include "chrome/browser/extensions/extension_action_manager.h" | 10 #include "chrome/browser/extensions/extension_action_manager.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 LocationBarViewMac* locationBarView = [toolbarController locationBarBridge]; | 226 LocationBarViewMac* locationBarView = [toolbarController locationBarBridge]; |
227 | 227 |
228 extensions::ExtensionActionManager* actionManager = | 228 extensions::ExtensionActionManager* actionManager = |
229 extensions::ExtensionActionManager::Get(browser_->profile()); | 229 extensions::ExtensionActionManager::Get(browser_->profile()); |
230 NSPoint popupPoint = NSZeroPoint; | 230 NSPoint popupPoint = NSZeroPoint; |
231 if (actionManager->GetPageAction(*extension_) == action_) { | 231 if (actionManager->GetPageAction(*extension_) == action_) { |
232 popupPoint = locationBarView->GetPageActionBubblePoint(action_); | 232 popupPoint = locationBarView->GetPageActionBubblePoint(action_); |
233 } else if (actionManager->GetBrowserAction(*extension_) == action_) { | 233 } else if (actionManager->GetBrowserAction(*extension_) == action_) { |
234 BrowserActionsController* controller = | 234 BrowserActionsController* controller = |
235 [toolbarController browserActionsController]; | 235 [toolbarController browserActionsController]; |
236 popupPoint = [controller popupPointForBrowserAction:extension_]; | 236 popupPoint = [controller popupPointForId:extension_->id()]; |
237 } else { | 237 } else { |
238 NOTREACHED() << "action_ is not a page action or browser action?"; | 238 NOTREACHED() << "action_ is not a page action or browser action?"; |
239 } | 239 } |
240 | 240 |
241 content::WebContents* activeTab = | 241 content::WebContents* activeTab = |
242 browser_->tab_strip_model()->GetActiveWebContents(); | 242 browser_->tab_strip_model()->GetActiveWebContents(); |
243 if (!activeTab) | 243 if (!activeTab) |
244 return; | 244 return; |
245 | 245 |
246 int tabId = extensions::ExtensionTabUtil::GetTabId(activeTab); | 246 int tabId = extensions::ExtensionTabUtil::GetTabId(activeTab); |
247 | 247 |
248 GURL url = action_->GetPopupUrl(tabId); | 248 GURL url = action_->GetPopupUrl(tabId); |
249 if (!url.is_valid()) | 249 if (!url.is_valid()) |
250 return; | 250 return; |
251 | 251 |
252 [ExtensionPopupController showURL:url | 252 [ExtensionPopupController showURL:url |
253 inBrowser:browser_ | 253 inBrowser:browser_ |
254 anchoredAt:popupPoint | 254 anchoredAt:popupPoint |
255 arrowLocation:info_bubble::kTopRight | 255 arrowLocation:info_bubble::kTopRight |
256 devMode:YES]; | 256 devMode:YES]; |
257 } | 257 } |
258 | 258 |
259 @end | 259 @end |
OLD | NEW |