OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/tabs/tab_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
10 #include "app/menus/accelerator_gtk.h" | 10 #include "app/menus/accelerator_gtk.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 tab_); | 62 tab_); |
63 } | 63 } |
64 virtual bool GetAcceleratorForCommandId( | 64 virtual bool GetAcceleratorForCommandId( |
65 int command_id, | 65 int command_id, |
66 menus::Accelerator* accelerator) { | 66 menus::Accelerator* accelerator) { |
67 int browser_command; | 67 int browser_command; |
68 if (!TabStripModel::ContextMenuCommandToBrowserCommand(command_id, | 68 if (!TabStripModel::ContextMenuCommandToBrowserCommand(command_id, |
69 &browser_command)) | 69 &browser_command)) |
70 return false; | 70 return false; |
71 const menus::AcceleratorGtk* accelerator_gtk = | 71 const menus::AcceleratorGtk* accelerator_gtk = |
72 Singleton<AcceleratorsGtk>()->GetPrimaryAcceleratorForCommand( | 72 AcceleratorsGtk::GetInstance()->GetPrimaryAcceleratorForCommand( |
73 browser_command); | 73 browser_command); |
74 if (accelerator_gtk) | 74 if (accelerator_gtk) |
75 *accelerator = *accelerator_gtk; | 75 *accelerator = *accelerator_gtk; |
76 return !!accelerator_gtk; | 76 return !!accelerator_gtk; |
77 } | 77 } |
78 | 78 |
79 virtual void ExecuteCommand(int command_id) { | 79 virtual void ExecuteCommand(int command_id) { |
80 if (!tab_) | 80 if (!tab_) |
81 return; | 81 return; |
82 tab_->delegate()->ExecuteCommandForTab( | 82 tab_->delegate()->ExecuteCommandForTab( |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 gdk_event_free(last_mouse_down_); | 388 gdk_event_free(last_mouse_down_); |
389 last_mouse_down_ = NULL; | 389 last_mouse_down_ = NULL; |
390 } | 390 } |
391 | 391 |
392 // Notify the drag helper that we're done with any potential drag operations. | 392 // Notify the drag helper that we're done with any potential drag operations. |
393 // Clean up the drag helper, which is re-created on the next mouse press. | 393 // Clean up the drag helper, which is re-created on the next mouse press. |
394 delegate_->EndDrag(canceled); | 394 delegate_->EndDrag(canceled); |
395 | 395 |
396 observer_.reset(); | 396 observer_.reset(); |
397 } | 397 } |
OLD | NEW |