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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h

Issue 10787037: browser/ui: Share BookmarkBarInstructions delegate between gtk and views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months 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
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 #ifndef CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" 16 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h"
17 #include "chrome/browser/bookmarks/bookmark_model_observer.h" 17 #include "chrome/browser/bookmarks/bookmark_model_observer.h"
18 #include "chrome/browser/prefs/pref_member.h" 18 #include "chrome/browser/prefs/pref_member.h"
19 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" 19 #include "chrome/browser/ui/bookmarks/bookmark_bar.h"
20 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h" 20 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h"
21 #include "chrome/browser/ui/gtk/menu_bar_helper.h" 21 #include "chrome/browser/ui/gtk/menu_bar_helper.h"
22 #include "chrome/browser/ui/gtk/view_id_util.h" 22 #include "chrome/browser/ui/gtk/view_id_util.h"
23 #include "content/public/browser/notification_observer.h" 23 #include "content/public/browser/notification_observer.h"
24 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
25 #include "ui/base/animation/animation.h" 25 #include "ui/base/animation/animation.h"
26 #include "ui/base/animation/animation_delegate.h" 26 #include "ui/base/animation/animation_delegate.h"
27 #include "ui/base/animation/slide_animation.h" 27 #include "ui/base/animation/slide_animation.h"
28 #include "ui/base/gtk/gtk_signal.h" 28 #include "ui/base/gtk/gtk_signal.h"
29 #include "ui/base/gtk/owned_widget_gtk.h" 29 #include "ui/base/gtk/owned_widget_gtk.h"
30 #include "ui/gfx/point.h" 30 #include "ui/gfx/point.h"
31 #include "ui/gfx/size.h" 31 #include "ui/gfx/size.h"
32 32
33 class BookmarkBarInstructionsGtk;
33 class BookmarkMenuController; 34 class BookmarkMenuController;
34 class Browser; 35 class Browser;
35 class BrowserWindowGtk; 36 class BrowserWindowGtk;
36 class GtkThemeService; 37 class GtkThemeService;
37 class MenuGtk; 38 class MenuGtk;
38 class TabstripOriginProvider; 39 class TabstripOriginProvider;
39 40
40 namespace content { 41 namespace content {
41 class PageNavigator; 42 class PageNavigator;
42 } 43 }
43 44
44 class BookmarkBarGtk : public ui::AnimationDelegate, 45 class BookmarkBarGtk : public ui::AnimationDelegate,
45 public BookmarkModelObserver, 46 public BookmarkModelObserver,
46 public MenuBarHelper::Delegate, 47 public MenuBarHelper::Delegate,
47 public content::NotificationObserver, 48 public content::NotificationObserver,
48 public BookmarkBarInstructionsGtk::Delegate, 49 public chrome::BookmarkBarInstructionsDelegate,
49 public BookmarkContextMenuControllerDelegate { 50 public BookmarkContextMenuControllerDelegate {
50 public: 51 public:
51 // The NTP needs to have access to this. 52 // The NTP needs to have access to this.
52 static const int kBookmarkBarNTPHeight; 53 static const int kBookmarkBarNTPHeight;
53 54
54 BookmarkBarGtk(BrowserWindowGtk* window, 55 BookmarkBarGtk(BrowserWindowGtk* window,
55 Browser* browser, 56 Browser* browser,
56 TabstripOriginProvider* tabstrip_origin_provider); 57 TabstripOriginProvider* tabstrip_origin_provider);
57 virtual ~BookmarkBarGtk(); 58 virtual ~BookmarkBarGtk();
58 59
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 GdkEventExpose*); 286 GdkEventExpose*);
286 CHROMEGTK_CALLBACK_0(BookmarkBarGtk, void, OnEventBoxDestroy); 287 CHROMEGTK_CALLBACK_0(BookmarkBarGtk, void, OnEventBoxDestroy);
287 288
288 // Callbacks on our parent widget. 289 // Callbacks on our parent widget.
289 CHROMEGTK_CALLBACK_1(BookmarkBarGtk, void, OnParentSizeAllocate, 290 CHROMEGTK_CALLBACK_1(BookmarkBarGtk, void, OnParentSizeAllocate,
290 GtkAllocation*); 291 GtkAllocation*);
291 292
292 // |throbbing_widget_| callback. 293 // |throbbing_widget_| callback.
293 CHROMEGTK_CALLBACK_0(BookmarkBarGtk, void, OnThrobbingWidgetDestroy); 294 CHROMEGTK_CALLBACK_0(BookmarkBarGtk, void, OnThrobbingWidgetDestroy);
294 295
295 // Overriden from BookmarkBarInstructionsGtk::Delegate. 296 // Overriden from chrome::BookmarkBarInstructionsDelegate:
296 virtual void ShowImportDialog() OVERRIDE; 297 virtual void ShowImportDialog() OVERRIDE;
297 298
298 // Updates the drag&drop state when |edit_bookmarks_enabled_| changes. 299 // Updates the drag&drop state when |edit_bookmarks_enabled_| changes.
299 void OnEditBookmarksEnabledChanged(); 300 void OnEditBookmarksEnabledChanged();
300 301
301 // Used for opening urls. 302 // Used for opening urls.
302 content::PageNavigator* page_navigator_; 303 content::PageNavigator* page_navigator_;
303 304
304 Browser* browser_; 305 Browser* browser_;
305 BrowserWindowGtk* window_; 306 BrowserWindowGtk* window_;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 406
406 BookmarkBar::State bookmark_bar_state_; 407 BookmarkBar::State bookmark_bar_state_;
407 408
408 // Maximum height of the bookmark bar. 409 // Maximum height of the bookmark bar.
409 int max_height_; 410 int max_height_;
410 411
411 DISALLOW_COPY_AND_ASSIGN(BookmarkBarGtk); 412 DISALLOW_COPY_AND_ASSIGN(BookmarkBarGtk);
412 }; 413 };
413 414
414 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_ 415 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698