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

Side by Side Diff: chrome/browser/gtk/bookmark_bar_gtk.cc

Issue 506012: Fix a node selection when creating a new item under the 'Other Bookmarks' (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/gtk/bookmark_bar_gtk.h" 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/gfx/gtk_util.h" 9 #include "app/gfx/gtk_util.h"
10 #include "app/gfx/canvas_paint.h" 10 #include "app/gfx/canvas_paint.h"
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 const BookmarkNode* node, 845 const BookmarkNode* node,
846 GdkEventButton* event) { 846 GdkEventButton* event) {
847 if (!model_->IsLoaded()) { 847 if (!model_->IsLoaded()) {
848 // Don't do anything if the model isn't loaded. 848 // Don't do anything if the model isn't loaded.
849 return; 849 return;
850 } 850 }
851 851
852 const BookmarkNode* parent = NULL; 852 const BookmarkNode* parent = NULL;
853 std::vector<const BookmarkNode*> nodes; 853 std::vector<const BookmarkNode*> nodes;
854 if (sender == other_bookmarks_button_) { 854 if (sender == other_bookmarks_button_) {
855 nodes.push_back(node);
855 parent = model_->GetBookmarkBarNode(); 856 parent = model_->GetBookmarkBarNode();
856 nodes.push_back(parent);
857 } else if (sender != bookmark_toolbar_.get()) { 857 } else if (sender != bookmark_toolbar_.get()) {
858 nodes.push_back(node); 858 nodes.push_back(node);
859 parent = node->GetParent(); 859 parent = node->GetParent();
860 } else { 860 } else {
861 parent = model_->GetBookmarkBarNode(); 861 parent = model_->GetBookmarkBarNode();
862 nodes.push_back(parent); 862 nodes.push_back(parent);
863 } 863 }
864 864
865 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender)); 865 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender));
866 current_context_menu_.reset(new BookmarkContextMenuGtk( 866 current_context_menu_.reset(new BookmarkContextMenuGtk(
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 string16 link_text; 1304 string16 link_text;
1305 sync_ui_util::MessageType sync_status; 1305 sync_ui_util::MessageType sync_status;
1306 sync_status = sync_ui_util::GetStatusLabels( 1306 sync_status = sync_ui_util::GetStatusLabels(
1307 sync_service_, &status_text, &link_text); 1307 sync_service_, &status_text, &link_text);
1308 if (sync_status == sync_ui_util::SYNC_ERROR) { 1308 if (sync_status == sync_ui_util::SYNC_ERROR) {
1309 show_sync_error_button = true; 1309 show_sync_error_button = true;
1310 } 1310 }
1311 } 1311 }
1312 return show_sync_error_button; 1312 return show_sync_error_button;
1313 } 1313 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698