| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ | 6 #define CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/gfx/rect.h" | 12 #include "base/gfx/rect.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
| 15 #include "chrome/browser/gtk/tabs/tab_gtk.h" | 15 #include "chrome/browser/gtk/tabs/tab_gtk.h" |
| 16 #include "chrome/browser/tabs/tab_strip_model.h" | 16 #include "chrome/browser/tabs/tab_strip_model.h" |
| 17 #include "chrome/common/owned_widget_gtk.h" | 17 #include "chrome/common/owned_widget_gtk.h" |
| 18 | 18 |
| 19 class CustomDrawButton; | 19 class CustomDrawButton; |
| 20 class DraggedTabControllerGtk; | 20 class DraggedTabControllerGtk; |
| 21 class GtkThemeProperties; |
| 21 | 22 |
| 22 class TabStripGtk : public TabStripModelObserver, | 23 class TabStripGtk : public TabStripModelObserver, |
| 23 public TabGtk::TabDelegate, | 24 public TabGtk::TabDelegate, |
| 24 public MessageLoopForUI::Observer { | 25 public MessageLoopForUI::Observer { |
| 25 public: | 26 public: |
| 26 class TabAnimation; | 27 class TabAnimation; |
| 27 | 28 |
| 28 explicit TabStripGtk(TabStripModel* model); | 29 explicit TabStripGtk(TabStripModel* model); |
| 29 virtual ~TabStripGtk(); | 30 virtual ~TabStripGtk(); |
| 30 | 31 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 77 |
| 77 // Return the origin of the tab strip in coordinates relative to where we | 78 // Return the origin of the tab strip in coordinates relative to where we |
| 78 // start drawing the background theme image. This is the x coordinate of | 79 // start drawing the background theme image. This is the x coordinate of |
| 79 // the origin of the GdkWindow of widget(), but the y coordinate of the origin | 80 // the origin of the GdkWindow of widget(), but the y coordinate of the origin |
| 80 // of widget() itself. | 81 // of widget() itself. |
| 81 // Used to help other widgets draw their background relative to the tabstrip. | 82 // Used to help other widgets draw their background relative to the tabstrip. |
| 82 // Should only be called after both the tabstrip and |widget| have been | 83 // Should only be called after both the tabstrip and |widget| have been |
| 83 // allocated. | 84 // allocated. |
| 84 gfx::Point GetTabStripOriginForWidget(GtkWidget* widget); | 85 gfx::Point GetTabStripOriginForWidget(GtkWidget* widget); |
| 85 | 86 |
| 87 // Alerts us that the theme changed, and we might need to change theme images. |
| 88 void UserChangedTheme(GtkThemeProperties* properties); |
| 89 |
| 86 protected: | 90 protected: |
| 87 // TabStripModelObserver implementation: | 91 // TabStripModelObserver implementation: |
| 88 virtual void TabInsertedAt(TabContents* contents, | 92 virtual void TabInsertedAt(TabContents* contents, |
| 89 int index, | 93 int index, |
| 90 bool foreground); | 94 bool foreground); |
| 91 virtual void TabDetachedAt(TabContents* contents, int index); | 95 virtual void TabDetachedAt(TabContents* contents, int index); |
| 92 virtual void TabSelectedAt(TabContents* old_contents, | 96 virtual void TabSelectedAt(TabContents* old_contents, |
| 93 TabContents* contents, | 97 TabContents* contents, |
| 94 int index, | 98 int index, |
| 95 bool user_gesture); | 99 bool user_gesture); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // ResizeLayoutTabsNow method. | 395 // ResizeLayoutTabsNow method. |
| 392 ScopedRunnableMethodFactory<TabStripGtk> resize_layout_factory_; | 396 ScopedRunnableMethodFactory<TabStripGtk> resize_layout_factory_; |
| 393 | 397 |
| 394 // True if the tabstrip has already been added as a MessageLoop observer. | 398 // True if the tabstrip has already been added as a MessageLoop observer. |
| 395 bool added_as_message_loop_observer_; | 399 bool added_as_message_loop_observer_; |
| 396 | 400 |
| 397 DISALLOW_COPY_AND_ASSIGN(TabStripGtk); | 401 DISALLOW_COPY_AND_ASSIGN(TabStripGtk); |
| 398 }; | 402 }; |
| 399 | 403 |
| 400 #endif // CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ | 404 #endif // CHROME_BROWSER_GTK_TABS_TAB_STRIP_GTK_H_ |
| OLD | NEW |