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

Side by Side Diff: chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_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_INSTRUCTIONS_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/public/browser/notification_observer.h" 10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h" 11 #include "content/public/browser/notification_registrar.h"
12 #include "ui/base/gtk/gtk_signal.h" 12 #include "ui/base/gtk/gtk_signal.h"
13 13
14 typedef struct _GtkWidget GtkWidget; 14 typedef struct _GtkWidget GtkWidget;
15 class GtkThemeService; 15 class GtkThemeService;
16 class Profile; 16 class Profile;
17 17
18 namespace chrome {
19 class BookmarkBarInstructionsDelegate;
20 }
21
18 class BookmarkBarInstructionsGtk : public content::NotificationObserver { 22 class BookmarkBarInstructionsGtk : public content::NotificationObserver {
19 public: 23 public:
20 // The delegate is notified once the user clicks on the link to import 24 BookmarkBarInstructionsGtk(chrome::BookmarkBarInstructionsDelegate* delegate,
21 // bookmarks. 25 Profile* profile);
22 class Delegate {
23 public:
24 virtual void ShowImportDialog() = 0;
25
26 protected:
27 virtual ~Delegate() {}
28 };
29
30 BookmarkBarInstructionsGtk(Delegate* delegate, Profile* profile);
31 26
32 // Get the native widget. 27 // Get the native widget.
33 GtkWidget* widget() const { return instructions_hbox_; } 28 GtkWidget* widget() const { return instructions_hbox_; }
34 29
35 private: 30 private:
36 // Overridden from content::NotificationObserver: 31 // Overridden from content::NotificationObserver:
37 virtual void Observe(int type, 32 virtual void Observe(int type,
38 const content::NotificationSource& source, 33 const content::NotificationSource& source,
39 const content::NotificationDetails& details) OVERRIDE; 34 const content::NotificationDetails& details) OVERRIDE;
40 35
41 CHROMEGTK_CALLBACK_0(BookmarkBarInstructionsGtk, void, OnButtonClick); 36 CHROMEGTK_CALLBACK_0(BookmarkBarInstructionsGtk, void, OnButtonClick);
42 37
43 // Sets the correct color for |instructions_label_| and |instructions_link_|. 38 // Sets the correct color for |instructions_label_| and |instructions_link_|.
44 void UpdateColors(); 39 void UpdateColors();
45 40
46 Delegate* delegate_; 41 chrome::BookmarkBarInstructionsDelegate* delegate_;
47 42
48 Profile* profile_; 43 Profile* profile_;
49 44
50 GtkThemeService* theme_service_; 45 GtkThemeService* theme_service_;
51 46
52 // HBox that holds the the label and link of bookmark bar import promotion. 47 // HBox that holds the the label and link of bookmark bar import promotion.
53 GtkWidget* instructions_hbox_; 48 GtkWidget* instructions_hbox_;
54 GtkWidget* instructions_label_; 49 GtkWidget* instructions_label_;
55 GtkWidget* instructions_link_; 50 GtkWidget* instructions_link_;
56 51
57 content::NotificationRegistrar registrar_; 52 content::NotificationRegistrar registrar_;
58 53
59 DISALLOW_COPY_AND_ASSIGN(BookmarkBarInstructionsGtk); 54 DISALLOW_COPY_AND_ASSIGN(BookmarkBarInstructionsGtk);
60 }; 55 };
61 56
62 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_ 57 #endif // CHROME_BROWSER_UI_GTK_BOOKMARKS_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc ('k') | chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698