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_BOOKMARK_EDITOR_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_BOOKMARK_EDITOR_GTK_H_ |
6 #define CHROME_BROWSER_GTK_BOOKMARK_EDITOR_GTK_H_ | 6 #define CHROME_BROWSER_GTK_BOOKMARK_EDITOR_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "app/gtk_signal.h" | 12 #include "app/gtk_signal.h" |
13 #include "base/scoped_ptr.h" | |
14 #include "chrome/browser/bookmarks/bookmark_editor.h" | 13 #include "chrome/browser/bookmarks/bookmark_editor.h" |
15 #include "chrome/browser/bookmarks/bookmark_model_observer.h" | 14 #include "chrome/browser/bookmarks/bookmark_model_observer.h" |
16 #include "testing/gtest/include/gtest/gtest_prod.h" | 15 #include "testing/gtest/include/gtest/gtest_prod.h" |
17 | 16 |
18 class GURL; | 17 class GURL; |
19 | 18 |
20 // GTK version of the bookmark editor dialog. | 19 // GTK version of the bookmark editor dialog. |
21 class BookmarkEditorGtk : public BookmarkEditor, | 20 class BookmarkEditorGtk : public BookmarkEditor, |
22 public BookmarkModelObserver { | 21 public BookmarkModelObserver { |
23 FRIEND_TEST(BookmarkEditorGtkTest, ChangeParent); | 22 FRIEND_TEST(BookmarkEditorGtkTest, ChangeParent); |
24 FRIEND_TEST(BookmarkEditorGtkTest, ChangeParentAndURL); | 23 FRIEND_TEST(BookmarkEditorGtkTest, ChangeParentAndURL); |
25 FRIEND_TEST(BookmarkEditorGtkTest, ChangeURLToExistingURL); | 24 FRIEND_TEST(BookmarkEditorGtkTest, ChangeURLToExistingURL); |
26 FRIEND_TEST(BookmarkEditorGtkTest, EditTitleKeepsPosition); | 25 FRIEND_TEST(BookmarkEditorGtkTest, EditTitleKeepsPosition); |
27 FRIEND_TEST(BookmarkEditorGtkTest, EditURLKeepsPosition); | 26 FRIEND_TEST(BookmarkEditorGtkTest, EditURLKeepsPosition); |
28 FRIEND_TEST(BookmarkEditorGtkTest, ModelsMatch); | 27 FRIEND_TEST(BookmarkEditorGtkTest, ModelsMatch); |
29 FRIEND_TEST(BookmarkEditorGtkTest, MoveToNewParent); | 28 FRIEND_TEST(BookmarkEditorGtkTest, MoveToNewParent); |
30 FRIEND_TEST(BookmarkEditorGtkTest, NewURL); | 29 FRIEND_TEST(BookmarkEditorGtkTest, NewURL); |
31 FRIEND_TEST(BookmarkEditorGtkTest, ChangeURLNoTree); | 30 FRIEND_TEST(BookmarkEditorGtkTest, ChangeURLNoTree); |
32 FRIEND_TEST(BookmarkEditorGtkTest, ChangeTitleNoTree); | 31 FRIEND_TEST(BookmarkEditorGtkTest, ChangeTitleNoTree); |
33 public: | 32 public: |
34 BookmarkEditorGtk(GtkWindow* window, | 33 BookmarkEditorGtk(GtkWindow* window, |
35 Profile* profile, | 34 Profile* profile, |
36 const BookmarkNode* parent, | 35 const BookmarkNode* parent, |
37 const EditDetails& details, | 36 const EditDetails& details, |
38 BookmarkEditor::Configuration configuration, | 37 BookmarkEditor::Configuration configuration); |
39 BookmarkEditor::Handler* handler); | |
40 | 38 |
41 virtual ~BookmarkEditorGtk(); | 39 virtual ~BookmarkEditorGtk(); |
42 | 40 |
43 void Show(); | 41 void Show(); |
44 void Close(); | 42 void Close(); |
45 | 43 |
46 private: | 44 private: |
47 void Init(GtkWindow* parent_window); | 45 void Init(GtkWindow* parent_window); |
48 | 46 |
49 // BookmarkModel observer methods. Any structural change results in | 47 // BookmarkModel observer methods. Any structural change results in |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Mode used to create nodes from. | 129 // Mode used to create nodes from. |
132 BookmarkModel* bb_model_; | 130 BookmarkModel* bb_model_; |
133 | 131 |
134 // If true, we're running the menu for the bookmark bar or other bookmarks | 132 // If true, we're running the menu for the bookmark bar or other bookmarks |
135 // nodes. | 133 // nodes. |
136 bool running_menu_for_root_; | 134 bool running_menu_for_root_; |
137 | 135 |
138 // Is the tree shown? | 136 // Is the tree shown? |
139 bool show_tree_; | 137 bool show_tree_; |
140 | 138 |
141 scoped_ptr<BookmarkEditor::Handler> handler_; | |
142 | |
143 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorGtk); | 139 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorGtk); |
144 }; | 140 }; |
145 | 141 |
146 #endif // CHROME_BROWSER_GTK_BOOKMARK_EDITOR_GTK_H_ | 142 #endif // CHROME_BROWSER_GTK_BOOKMARK_EDITOR_GTK_H_ |
OLD | NEW |