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_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 // Only one popup should be visible at a time. | 853 // Only one popup should be visible at a time. |
854 HidePopup(); | 854 HidePopup(); |
855 | 855 |
856 if (same_showing) | 856 if (same_showing) |
857 return false; | 857 return false; |
858 | 858 |
859 // We can get the execute event for browser actions that are not visible, | 859 // We can get the execute event for browser actions that are not visible, |
860 // since buttons can be activated from the overflow menu (chevron). In that | 860 // since buttons can be activated from the overflow menu (chevron). In that |
861 // case we show the popup as originating from the chevron. | 861 // case we show the popup as originating from the chevron. |
862 View* reference_view = button->parent()->visible() ? button : chevron_; | 862 View* reference_view = button->parent()->visible() ? button : chevron_; |
863 views::BubbleBorder::Arrow arrow = base::i18n::IsRTL() ? | 863 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, reference_view, |
864 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 864 views::BubbleBorder::TOP_RIGHT, |
865 popup_ = ExtensionPopup::ShowPopup(popup_url, | |
866 browser_, | |
867 reference_view, | |
868 arrow, | |
869 show_action); | 865 show_action); |
870 popup_->GetWidget()->AddObserver(this); | 866 popup_->GetWidget()->AddObserver(this); |
871 popup_button_ = button; | 867 popup_button_ = button; |
872 | 868 |
873 // Only set button as pushed if it was triggered by a user click. | 869 // Only set button as pushed if it was triggered by a user click. |
874 if (should_grant) | 870 if (should_grant) |
875 popup_button_->SetButtonPushed(); | 871 popup_button_->SetButtonPushed(); |
876 return true; | 872 return true; |
877 } | 873 } |
OLD | NEW |