Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: chrome/browser/ui/views/browser_action_view.cc

Issue 11365046: Redirect behaviour of gesture events on browser action buttons appropriately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/browser_action_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/browser_action_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698