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/singleton.h" | 9 #include "base/singleton.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
12 #include "chrome/browser/ui/gtk/accelerators_gtk.h" | 12 #include "chrome/browser/ui/gtk/accelerators_gtk.h" |
13 #include "chrome/browser/ui/gtk/menu_gtk.h" | 13 #include "chrome/browser/ui/gtk/menu_gtk.h" |
14 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 14 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
15 #include "gfx/path.h" | |
16 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
17 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
18 #include "ui/base/dragdrop/gtk_dnd_util.h" | 17 #include "ui/base/dragdrop/gtk_dnd_util.h" |
19 #include "ui/base/models/accelerator_gtk.h" | 18 #include "ui/base/models/accelerator_gtk.h" |
| 19 #include "ui/gfx/path.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // Returns the width of the title for the current font, in pixels. | 23 // Returns the width of the title for the current font, in pixels. |
24 int GetTitleWidth(gfx::Font* font, string16 title) { | 24 int GetTitleWidth(gfx::Font* font, string16 title) { |
25 DCHECK(font); | 25 DCHECK(font); |
26 if (title.empty()) | 26 if (title.empty()) |
27 return 0; | 27 return 0; |
28 | 28 |
29 return font->GetStringWidth(title); | 29 return font->GetStringWidth(title); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 gdk_event_free(last_mouse_down_); | 389 gdk_event_free(last_mouse_down_); |
390 last_mouse_down_ = NULL; | 390 last_mouse_down_ = NULL; |
391 } | 391 } |
392 | 392 |
393 // Notify the drag helper that we're done with any potential drag operations. | 393 // Notify the drag helper that we're done with any potential drag operations. |
394 // Clean up the drag helper, which is re-created on the next mouse press. | 394 // Clean up the drag helper, which is re-created on the next mouse press. |
395 delegate_->EndDrag(canceled); | 395 delegate_->EndDrag(canceled); |
396 | 396 |
397 observer_.reset(); | 397 observer_.reset(); |
398 } | 398 } |
OLD | NEW |