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

Side by Side Diff: chrome/browser/gtk/bookmark_manager_gtk.h

Issue 132048: Don't crash when reusing a bookmark context menu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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) 2009 The Chromium Authors. All rights reserved.TIT 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.TIT
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_MANAGER_GTK_H_ 5 #ifndef CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_
6 #define CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_ 6 #define CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // SelectFileDialog::Listener implemenation. 69 // SelectFileDialog::Listener implemenation.
70 virtual void FileSelected(const FilePath& path, 70 virtual void FileSelected(const FilePath& path,
71 int index, void* params); 71 int index, void* params);
72 72
73 private: 73 private:
74 explicit BookmarkManagerGtk(Profile* profile); 74 explicit BookmarkManagerGtk(Profile* profile);
75 75
76 void InitWidgets(); 76 void InitWidgets();
77 GtkWidget* MakeLeftPane(); 77 GtkWidget* MakeLeftPane();
78 GtkWidget* MakeRightPane(); 78 GtkWidget* MakeRightPane();
79 // If |left|, then make the organize menu refer to that which is selected in
80 // the left pane, otherwise use the right pane selection.
81 void ResetOrganizeMenu(bool left);
79 82
80 // Pack the data from the bookmark model into the stores. This does not 83 // Pack the data from the bookmark model into the stores. This does not
81 // create the stores, which is done in Make{Left,Right}Pane(). 84 // create the stores, which is done in Make{Left,Right}Pane().
82 // This one should only be called once (when the bookmark model is loaded). 85 // This one should only be called once (when the bookmark model is loaded).
83 void BuildLeftStore(); 86 void BuildLeftStore();
84 // This one clears the old right pane and refills it with the contents of 87 // This one clears the old right pane and refills it with the contents of
85 // whatever folder is selected on the left. It can be called multiple times. 88 // whatever folder is selected on the left. It can be called multiple times.
86 void BuildRightStore(); 89 void BuildRightStore();
87 90
88 // Get the ID of the item at |iter|. 91 // Get the ID of the item at |iter|.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 GdkDragContext* drag_context, BookmarkManagerGtk* bookmark_manager); 172 GdkDragContext* drag_context, BookmarkManagerGtk* bookmark_manager);
170 173
171 static gboolean OnRightTreeViewDragMotion(GtkWidget* tree_view, 174 static gboolean OnRightTreeViewDragMotion(GtkWidget* tree_view,
172 GdkDragContext* context, gint x, gint y, guint time, 175 GdkDragContext* context, gint x, gint y, guint time,
173 BookmarkManagerGtk* bookmark_manager); 176 BookmarkManagerGtk* bookmark_manager);
174 177
175 static void OnRightTreeViewRowActivated(GtkTreeView* tree_view, 178 static void OnRightTreeViewRowActivated(GtkTreeView* tree_view,
176 GtkTreePath* path, GtkTreeViewColumn* column, 179 GtkTreePath* path, GtkTreeViewColumn* column,
177 BookmarkManagerGtk* bookmark_manager); 180 BookmarkManagerGtk* bookmark_manager);
178 181
182 static void OnRightTreeViewFocusIn(GtkTreeView* tree_view,
183 GdkEventFocus* event, BookmarkManagerGtk* bookmark_manager);
184
185 static void OnLeftTreeViewFocusIn(GtkTreeView* tree_view,
186 GdkEventFocus* event, BookmarkManagerGtk* bookmark_manager);
187
179 // Tools menu item callbacks. 188 // Tools menu item callbacks.
180 static void OnImportItemActivated(GtkMenuItem* menuitem, 189 static void OnImportItemActivated(GtkMenuItem* menuitem,
181 BookmarkManagerGtk* bookmark_manager); 190 BookmarkManagerGtk* bookmark_manager);
182 static void OnExportItemActivated(GtkMenuItem* menuitem, 191 static void OnExportItemActivated(GtkMenuItem* menuitem,
183 BookmarkManagerGtk* bookmark_manager); 192 BookmarkManagerGtk* bookmark_manager);
184 193
185 GtkWidget* window_; 194 GtkWidget* window_;
186 GtkWidget* search_entry_; 195 GtkWidget* search_entry_;
187 Profile* profile_; 196 Profile* profile_;
188 BookmarkModel* model_; 197 BookmarkModel* model_;
189 GtkWidget* left_tree_view_; 198 GtkWidget* left_tree_view_;
190 GtkWidget* right_tree_view_; 199 GtkWidget* right_tree_view_;
191 200
192 enum { 201 enum {
193 RIGHT_PANE_PIXBUF, 202 RIGHT_PANE_PIXBUF,
194 RIGHT_PANE_TITLE, 203 RIGHT_PANE_TITLE,
195 RIGHT_PANE_URL, 204 RIGHT_PANE_URL,
196 RIGHT_PANE_PATH, 205 RIGHT_PANE_PATH,
197 RIGHT_PANE_ID, 206 RIGHT_PANE_ID,
198 RIGHT_PANE_NUM 207 RIGHT_PANE_NUM
199 }; 208 };
200 GtkTreeStore* left_store_; 209 GtkTreeStore* left_store_;
201 GtkListStore* right_store_; 210 GtkListStore* right_store_;
202 GtkTreeViewColumn* path_column_; 211 GtkTreeViewColumn* path_column_;
203 scoped_ptr<BookmarkTableModel> right_tree_model_; 212 scoped_ptr<BookmarkTableModel> right_tree_model_;
204 213
214 // The Organize menu item.
215 GtkWidget* organize_;
216 // The submenu the item pops up.
205 scoped_ptr<BookmarkContextMenu> organize_menu_; 217 scoped_ptr<BookmarkContextMenu> organize_menu_;
218 // Whether the menu refers to the left selection.
219 bool organize_is_for_left_;
206 220
207 // Factory used for delaying search. 221 // Factory used for delaying search.
208 ScopedRunnableMethodFactory<BookmarkManagerGtk> search_factory_; 222 ScopedRunnableMethodFactory<BookmarkManagerGtk> search_factory_;
209 223
210 scoped_refptr<SelectFileDialog> select_file_dialog_; 224 scoped_refptr<SelectFileDialog> select_file_dialog_;
211 }; 225 };
212 226
213 #endif // CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_ 227 #endif // CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_context_menu.h ('k') | chrome/browser/gtk/bookmark_manager_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698