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/ui/views/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 content::WebContents* active_tab = | 466 content::WebContents* active_tab = |
467 browser_->tab_strip_model()->GetActiveWebContents(); | 467 browser_->tab_strip_model()->GetActiveWebContents(); |
468 if (!active_tab) | 468 if (!active_tab) |
469 return -1; | 469 return -1; |
470 | 470 |
471 return SessionTabHelper::FromWebContents(active_tab)->session_id().id(); | 471 return SessionTabHelper::FromWebContents(active_tab)->session_id().id(); |
472 } | 472 } |
473 | 473 |
474 void BrowserActionsContainer::OnBrowserActionExecuted( | 474 void BrowserActionsContainer::OnBrowserActionExecuted( |
475 BrowserActionButton* button) { | 475 BrowserActionButton* button) { |
| 476 // Show popup here for aura. |
476 ShowPopup(button, ExtensionPopup::SHOW); | 477 ShowPopup(button, ExtensionPopup::SHOW); |
477 } | 478 } |
478 | 479 |
479 void BrowserActionsContainer::OnBrowserActionVisibilityChanged() { | 480 void BrowserActionsContainer::OnBrowserActionVisibilityChanged() { |
480 SetVisible(!browser_action_views_.empty()); | 481 SetVisible(!browser_action_views_.empty()); |
481 owner_view_->Layout(); | 482 owner_view_->Layout(); |
482 owner_view_->SchedulePaint(); | 483 owner_view_->SchedulePaint(); |
483 } | 484 } |
484 | 485 |
485 gfx::Point BrowserActionsContainer::GetViewContentOffset() const { | 486 gfx::Point BrowserActionsContainer::GetViewContentOffset() const { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 841 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
841 popup_ = ExtensionPopup::ShowPopup(popup_url, | 842 popup_ = ExtensionPopup::ShowPopup(popup_url, |
842 browser_, | 843 browser_, |
843 reference_view, | 844 reference_view, |
844 arrow, | 845 arrow, |
845 show_action); | 846 show_action); |
846 popup_->GetWidget()->AddObserver(this); | 847 popup_->GetWidget()->AddObserver(this); |
847 popup_button_ = button; | 848 popup_button_ = button; |
848 popup_button_->SetButtonPushed(); | 849 popup_button_->SetButtonPushed(); |
849 } | 850 } |
OLD | NEW |