| 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_action_view.h" | 5 #include "chrome/browser/ui/views/browser_action_view.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/api/commands/command_service.h" | 8 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" | 9 #include "chrome/browser/extensions/api/commands/command_service_factory.h" |
| 10 #include "chrome/browser/extensions/extension_action.h" | 10 #include "chrome/browser/extensions/extension_action.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 MenuButton::OnMouseExited(event); | 338 MenuButton::OnMouseExited(event); |
| 339 else | 339 else |
| 340 TextButton::OnMouseExited(event); | 340 TextButton::OnMouseExited(event); |
| 341 } | 341 } |
| 342 | 342 |
| 343 bool BrowserActionButton::OnKeyReleased(const ui::KeyEvent& event) { | 343 bool BrowserActionButton::OnKeyReleased(const ui::KeyEvent& event) { |
| 344 return IsPopup() ? MenuButton::OnKeyReleased(event) : | 344 return IsPopup() ? MenuButton::OnKeyReleased(event) : |
| 345 TextButton::OnKeyReleased(event); | 345 TextButton::OnKeyReleased(event); |
| 346 } | 346 } |
| 347 | 347 |
| 348 ui::EventResult BrowserActionButton::OnGestureEvent(ui::GestureEvent* event) { | 348 void BrowserActionButton::OnGestureEvent(ui::GestureEvent* event) { |
| 349 return IsPopup() ? MenuButton::OnGestureEvent(event) : | 349 if (IsPopup()) |
| 350 TextButton::OnGestureEvent(event); | 350 MenuButton::OnGestureEvent(event); |
| 351 else |
| 352 TextButton::OnGestureEvent(event); |
| 351 } | 353 } |
| 352 | 354 |
| 353 bool BrowserActionButton::AcceleratorPressed( | 355 bool BrowserActionButton::AcceleratorPressed( |
| 354 const ui::Accelerator& accelerator) { | 356 const ui::Accelerator& accelerator) { |
| 355 delegate_->OnBrowserActionExecuted(this); | 357 delegate_->OnBrowserActionExecuted(this); |
| 356 return true; | 358 return true; |
| 357 } | 359 } |
| 358 | 360 |
| 359 void BrowserActionButton::SetButtonPushed() { | 361 void BrowserActionButton::SetButtonPushed() { |
| 360 SetState(views::CustomButton::STATE_PRESSED); | 362 SetState(views::CustomButton::STATE_PRESSED); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 404 |
| 403 extensions::Command browser_action_command; | 405 extensions::Command browser_action_command; |
| 404 if (!only_if_active || !command_service->GetBrowserActionCommand( | 406 if (!only_if_active || !command_service->GetBrowserActionCommand( |
| 405 extension_->id(), | 407 extension_->id(), |
| 406 extensions::CommandService::ACTIVE_ONLY, | 408 extensions::CommandService::ACTIVE_ONLY, |
| 407 &browser_action_command, | 409 &browser_action_command, |
| 408 NULL)) { | 410 NULL)) { |
| 409 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); | 411 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); |
| 410 } | 412 } |
| 411 } | 413 } |
| OLD | NEW |