| Index: chrome/browser/views/browser_actions_container.cc
|
| ===================================================================
|
| --- chrome/browser/views/browser_actions_container.cc (revision 35006)
|
| +++ chrome/browser/views/browser_actions_container.cc (working copy)
|
| @@ -54,11 +54,10 @@
|
| browser_action_(extension->browser_action()),
|
| extension_(extension),
|
| tracker_(NULL),
|
| - showing_context_menu_(false),
|
| panel_(panel) {
|
| set_alignment(TextButton::ALIGN_CENTER);
|
|
|
| - // No UpdateState() here because View hierarchy not setup yet. Our parent
|
| + // No UpdateState() here because View heirarchy not setup yet. Our parent
|
| // should call UpdateState() after creation.
|
|
|
| registrar_.Add(this, NotificationType::EXTENSION_BROWSER_ACTION_UPDATED,
|
| @@ -154,32 +153,14 @@
|
| }
|
|
|
| bool BrowserActionButton::OnMousePressed(const views::MouseEvent& e) {
|
| - showing_context_menu_ = e.IsRightMouseButton();
|
| - if (showing_context_menu_) {
|
| - SetButtonPushed();
|
| -
|
| - // Get the top left point of this button in screen coordinates.
|
| - gfx::Point point = gfx::Point(0, 0);
|
| - ConvertPointToScreen(this, &point);
|
| -
|
| - // Make the menu appear below the button.
|
| - point.Offset(0, height());
|
| -
|
| - if (!context_menu_.get())
|
| - context_menu_.reset(new ExtensionActionContextMenu());
|
| - context_menu_->Run(extension(), point);
|
| -
|
| - SetButtonNotPushed();
|
| - return false;
|
| - } else if (IsPopup()) {
|
| + if (IsPopup())
|
| return MenuButton::OnMousePressed(e);
|
| - }
|
| return TextButton::OnMousePressed(e);
|
| }
|
|
|
| void BrowserActionButton::OnMouseReleased(const views::MouseEvent& e,
|
| bool canceled) {
|
| - if (IsPopup() || showing_context_menu_) {
|
| + if (IsPopup()) {
|
| // TODO(erikkay) this never actually gets called (probably because of the
|
| // loss of focus).
|
| MenuButton::OnMouseReleased(e, canceled);
|
| @@ -195,18 +176,18 @@
|
| }
|
|
|
| void BrowserActionButton::OnMouseExited(const views::MouseEvent& e) {
|
| - if (IsPopup() || showing_context_menu_)
|
| + if (IsPopup())
|
| MenuButton::OnMouseExited(e);
|
| else
|
| TextButton::OnMouseExited(e);
|
| }
|
|
|
| -void BrowserActionButton::SetButtonPushed() {
|
| +void BrowserActionButton::PopupDidShow() {
|
| SetState(views::CustomButton::BS_PUSHED);
|
| menu_visible_ = true;
|
| }
|
|
|
| -void BrowserActionButton::SetButtonNotPushed() {
|
| +void BrowserActionButton::PopupDidHide() {
|
| SetState(views::CustomButton::BS_NORMAL);
|
| menu_visible_ = false;
|
| }
|
| @@ -367,7 +348,7 @@
|
|
|
| closing_popup->DetachFromBrowser();
|
| delete closing_popup;
|
| - closing_button->SetButtonNotPushed();
|
| + closing_button->PopupDidHide();
|
| return;
|
| }
|
| }
|
| @@ -405,7 +386,7 @@
|
| BubbleBorder::TOP_RIGHT);
|
| popup_->set_delegate(this);
|
| popup_button_ = button;
|
| - popup_button_->SetButtonPushed();
|
| + popup_button_->PopupDidShow();
|
| return;
|
| }
|
|
|
|
|