Chromium Code Reviews| 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) { | |
| 349 return IsPopup() ? MenuButton::OnGestureEvent(event) | |
| 350 : TextButton::OnGestureEvent(event); | |
|
sky
2012/11/01 21:50:15
: should be on the previous line.
| |
| 351 } | |
| 352 | |
| 348 bool BrowserActionButton::AcceleratorPressed( | 353 bool BrowserActionButton::AcceleratorPressed( |
| 349 const ui::Accelerator& accelerator) { | 354 const ui::Accelerator& accelerator) { |
| 350 delegate_->OnBrowserActionExecuted(this); | 355 delegate_->OnBrowserActionExecuted(this); |
| 351 return true; | 356 return true; |
| 352 } | 357 } |
| 353 | 358 |
| 354 void BrowserActionButton::SetButtonPushed() { | 359 void BrowserActionButton::SetButtonPushed() { |
| 355 SetState(views::CustomButton::BS_PUSHED); | 360 SetState(views::CustomButton::BS_PUSHED); |
| 356 menu_visible_ = true; | 361 menu_visible_ = true; |
| 357 } | 362 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 | 402 |
| 398 extensions::Command browser_action_command; | 403 extensions::Command browser_action_command; |
| 399 if (!only_if_active || !command_service->GetBrowserActionCommand( | 404 if (!only_if_active || !command_service->GetBrowserActionCommand( |
| 400 extension_->id(), | 405 extension_->id(), |
| 401 extensions::CommandService::ACTIVE_ONLY, | 406 extensions::CommandService::ACTIVE_ONLY, |
| 402 &browser_action_command, | 407 &browser_action_command, |
| 403 NULL)) { | 408 NULL)) { |
| 404 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); | 409 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); |
| 405 } | 410 } |
| 406 } | 411 } |
| OLD | NEW |