| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/tabs/tab_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/tab_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (!tab_) | 80 if (!tab_) |
| 81 return; | 81 return; |
| 82 tab_->delegate()->ExecuteCommandForTab( | 82 tab_->delegate()->ExecuteCommandForTab( |
| 83 static_cast<TabStripModel::ContextMenuCommand>(command_id), tab_); | 83 static_cast<TabStripModel::ContextMenuCommand>(command_id), tab_); |
| 84 } | 84 } |
| 85 | 85 |
| 86 GtkWidget* GetImageForCommandId(int command_id) const { | 86 GtkWidget* GetImageForCommandId(int command_id) const { |
| 87 int browser_cmd_id; | 87 int browser_cmd_id; |
| 88 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, | 88 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, |
| 89 &browser_cmd_id) ? | 89 &browser_cmd_id) ? |
| 90 MenuGtk::Delegate::GetDefaultImageForCommandId(browser_cmd_id) : | 90 GtkMenuCreator::GetDefaultImageForCommandId(browser_cmd_id) : |
| 91 NULL; | 91 NULL; |
| 92 } | 92 } |
| 93 | 93 |
| 94 // The context menu. | 94 // The context menu. |
| 95 scoped_ptr<MenuGtk> menu_; | 95 scoped_ptr<MenuGtk> menu_; |
| 96 | 96 |
| 97 // The Tab the context menu was brought up for. Set to NULL when the menu | 97 // The Tab the context menu was brought up for. Set to NULL when the menu |
| 98 // is canceled. | 98 // is canceled. |
| 99 TabGtk* tab_; | 99 TabGtk* tab_; |
| 100 | 100 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 gdk_event_free(last_mouse_down_); | 387 gdk_event_free(last_mouse_down_); |
| 388 last_mouse_down_ = NULL; | 388 last_mouse_down_ = NULL; |
| 389 } | 389 } |
| 390 | 390 |
| 391 // Notify the drag helper that we're done with any potential drag operations. | 391 // Notify the drag helper that we're done with any potential drag operations. |
| 392 // Clean up the drag helper, which is re-created on the next mouse press. | 392 // Clean up the drag helper, which is re-created on the next mouse press. |
| 393 delegate_->EndDrag(canceled); | 393 delegate_->EndDrag(canceled); |
| 394 | 394 |
| 395 observer_.reset(); | 395 observer_.reset(); |
| 396 } | 396 } |
| OLD | NEW |