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 #include "chrome/browser/ui/views/toolbar/browser_action_view.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 views::Widget* BrowserActionView::GetParentForContextMenu() { | 303 views::Widget* BrowserActionView::GetParentForContextMenu() { |
304 // RunMenuAt expects a nested menu to be parented by the same widget as the | 304 // RunMenuAt expects a nested menu to be parented by the same widget as the |
305 // already visible menu, in this case the Chrome menu. | 305 // already visible menu, in this case the Chrome menu. |
306 return delegate_->ShownInsideMenu() ? | 306 return delegate_->ShownInsideMenu() ? |
307 BrowserView::GetBrowserViewForBrowser(view_controller_->browser()) | 307 BrowserView::GetBrowserViewForBrowser(view_controller_->browser()) |
308 ->toolbar()->app_menu()->GetWidget() : | 308 ->toolbar()->app_menu()->GetWidget() : |
309 GetWidget(); | 309 GetWidget(); |
310 } | 310 } |
311 | 311 |
| 312 ExtensionActionViewController* |
| 313 BrowserActionView::GetPreferredPopupViewController() { |
| 314 return delegate_->ShownInsideMenu() ? |
| 315 delegate_->GetMainViewForExtension(extension())->view_controller() : |
| 316 view_controller(); |
| 317 } |
| 318 |
312 views::View* BrowserActionView::GetReferenceViewForPopup() { | 319 views::View* BrowserActionView::GetReferenceViewForPopup() { |
313 // Browser actions in the overflow menu can still show popups, so we may need | 320 // Browser actions in the overflow menu can still show popups, so we may need |
314 // a reference view other than this button's parent. If so, use the overflow | 321 // a reference view other than this button's parent. If so, use the overflow |
315 // view. | 322 // view. |
316 return visible() ? this : delegate_->GetOverflowReferenceView(); | 323 return visible() ? this : delegate_->GetOverflowReferenceView(); |
317 } | 324 } |
318 | 325 |
319 content::WebContents* BrowserActionView::GetCurrentWebContents() { | 326 content::WebContents* BrowserActionView::GetCurrentWebContents() { |
320 return delegate_->GetCurrentWebContents(); | 327 return delegate_->GetCurrentWebContents(); |
321 } | 328 } |
(...skipping 17 matching lines...) Expand all Loading... |
339 delegate_->SetPopupOwner(NULL); | 346 delegate_->SetPopupOwner(NULL); |
340 } | 347 } |
341 | 348 |
342 void BrowserActionView::OnWillShowContextMenus() { | 349 void BrowserActionView::OnWillShowContextMenus() { |
343 SetButtonPushed(); | 350 SetButtonPushed(); |
344 } | 351 } |
345 | 352 |
346 void BrowserActionView::OnContextMenuDone() { | 353 void BrowserActionView::OnContextMenuDone() { |
347 SetButtonNotPushed(); | 354 SetButtonNotPushed(); |
348 } | 355 } |
OLD | NEW |