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

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

Issue 7574021: Remove frontend code that allows for dynamic profile setting, and read the profile off the browse... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/gtk/bookmarks/bookmark_bar_gtk.h" 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, 114 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
115 extension_misc::APP_LAUNCH_BOOKMARK_BAR, 115 extension_misc::APP_LAUNCH_BOOKMARK_BAR,
116 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); 116 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY);
117 } 117 }
118 118
119 } // namespace 119 } // namespace
120 120
121 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57; 121 const int BookmarkBarGtk::kBookmarkBarNTPHeight = 57;
122 122
123 BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window, 123 BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window,
124 Profile* profile, Browser* browser, 124 Browser* browser,
125 TabstripOriginProvider* tabstrip_origin_provider) 125 TabstripOriginProvider* tabstrip_origin_provider)
126 : profile_(NULL), 126 : page_navigator_(NULL),
127 page_navigator_(NULL),
128 browser_(browser), 127 browser_(browser),
129 window_(window), 128 window_(window),
130 tabstrip_origin_provider_(tabstrip_origin_provider), 129 tabstrip_origin_provider_(tabstrip_origin_provider),
131 model_(NULL), 130 model_(NULL),
132 instructions_(NULL), 131 instructions_(NULL),
133 sync_service_(NULL), 132 sync_service_(NULL),
134 dragged_node_(NULL), 133 dragged_node_(NULL),
135 drag_icon_(NULL), 134 drag_icon_(NULL),
136 toolbar_drop_item_(NULL), 135 toolbar_drop_item_(NULL),
137 theme_service_(GtkThemeService::GetFrom(profile)), 136 theme_service_(GtkThemeService::GetFrom(browser->profile())),
138 show_instructions_(true), 137 show_instructions_(true),
139 menu_bar_helper_(this), 138 menu_bar_helper_(this),
140 slide_animation_(this), 139 slide_animation_(this),
141 last_allocation_width_(-1), 140 last_allocation_width_(-1),
142 throbbing_widget_(NULL), 141 throbbing_widget_(NULL),
143 method_factory_(this), 142 method_factory_(this),
144 bookmark_bar_state_(BookmarkBar::DETACHED) { 143 bookmark_bar_state_(BookmarkBar::DETACHED) {
144 Profile* profile = browser->profile();
145 if (profile->GetProfileSyncService()) { 145 if (profile->GetProfileSyncService()) {
146 // Obtain a pointer to the profile sync service and add our instance as an 146 // Obtain a pointer to the profile sync service and add our instance as an
147 // observer. 147 // observer.
148 sync_service_ = profile->GetProfileSyncService(); 148 sync_service_ = profile->GetProfileSyncService();
149 sync_service_->AddObserver(this); 149 sync_service_->AddObserver(this);
150 } 150 }
151 151
152 Init(profile); 152 Init();
153 SetProfile(profile);
154 // Force an update by simulating being in the wrong state. 153 // Force an update by simulating being in the wrong state.
155 // BrowserWindowGtk sets our true state after we're created. 154 // BrowserWindowGtk sets our true state after we're created.
156 SetBookmarkBarState(BookmarkBar::SHOW, 155 SetBookmarkBarState(BookmarkBar::SHOW,
157 BookmarkBar::DONT_ANIMATE_STATE_CHANGE); 156 BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
158 157
159 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, 158 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
160 Source<ThemeService>(theme_service_)); 159 Source<ThemeService>(theme_service_));
161 160
162 edit_bookmarks_enabled_.Init(prefs::kEditBookmarksEnabled, 161 edit_bookmarks_enabled_.Init(prefs::kEditBookmarksEnabled,
163 profile_->GetPrefs(), this); 162 profile->GetPrefs(), this);
164 OnEditBookmarksEnabledChanged(); 163 OnEditBookmarksEnabledChanged();
165 } 164 }
166 165
167 BookmarkBarGtk::~BookmarkBarGtk() { 166 BookmarkBarGtk::~BookmarkBarGtk() {
168 RemoveAllBookmarkButtons(); 167 RemoveAllBookmarkButtons();
169 bookmark_toolbar_.Destroy(); 168 bookmark_toolbar_.Destroy();
170 event_box_.Destroy(); 169 event_box_.Destroy();
171 } 170 }
172 171
173 void BookmarkBarGtk::SetProfile(Profile* profile) {
174 DCHECK(profile);
175 if (profile_ == profile)
176 return;
177
178 RemoveAllBookmarkButtons();
179
180 profile_ = profile;
181
182 if (model_)
183 model_->RemoveObserver(this);
184
185 // TODO(erg): Handle extensions
186
187 model_ = profile_->GetBookmarkModel();
188 model_->AddObserver(this);
189 if (model_->IsLoaded())
190 Loaded(model_, false);
191
192 // else case: we'll receive notification back from the BookmarkModel when done
193 // loading, then we'll populate the bar.
194 }
195
196 void BookmarkBarGtk::SetPageNavigator(PageNavigator* navigator) { 172 void BookmarkBarGtk::SetPageNavigator(PageNavigator* navigator) {
197 page_navigator_ = navigator; 173 page_navigator_ = navigator;
198 } 174 }
199 175
200 void BookmarkBarGtk::Init(Profile* profile) { 176 void BookmarkBarGtk::Init() {
201 event_box_.Own(gtk_event_box_new()); 177 event_box_.Own(gtk_event_box_new());
202 g_signal_connect(event_box_.get(), "destroy", 178 g_signal_connect(event_box_.get(), "destroy",
203 G_CALLBACK(&OnEventBoxDestroyThunk), this); 179 G_CALLBACK(&OnEventBoxDestroyThunk), this);
204 g_signal_connect(event_box_.get(), "button-press-event", 180 g_signal_connect(event_box_.get(), "button-press-event",
205 G_CALLBACK(&OnButtonPressedThunk), this); 181 G_CALLBACK(&OnButtonPressedThunk), this);
206 182
207 ntp_padding_box_ = gtk_alignment_new(0, 0, 1, 1); 183 ntp_padding_box_ = gtk_alignment_new(0, 0, 1, 1);
208 gtk_container_add(GTK_CONTAINER(event_box_.get()), ntp_padding_box_); 184 gtk_container_add(GTK_CONTAINER(event_box_.get()), ntp_padding_box_);
209 185
210 paint_box_ = gtk_event_box_new(); 186 paint_box_ = gtk_event_box_new();
211 gtk_container_add(GTK_CONTAINER(ntp_padding_box_), paint_box_); 187 gtk_container_add(GTK_CONTAINER(ntp_padding_box_), paint_box_);
212 GdkColor paint_box_color = 188 GdkColor paint_box_color =
213 theme_service_->GetGdkColor(ThemeService::COLOR_TOOLBAR); 189 theme_service_->GetGdkColor(ThemeService::COLOR_TOOLBAR);
214 gtk_widget_modify_bg(paint_box_, GTK_STATE_NORMAL, &paint_box_color); 190 gtk_widget_modify_bg(paint_box_, GTK_STATE_NORMAL, &paint_box_color);
215 gtk_widget_add_events(paint_box_, GDK_POINTER_MOTION_MASK | 191 gtk_widget_add_events(paint_box_, GDK_POINTER_MOTION_MASK |
216 GDK_BUTTON_PRESS_MASK); 192 GDK_BUTTON_PRESS_MASK);
217 193
218 bookmark_hbox_ = gtk_hbox_new(FALSE, 0); 194 bookmark_hbox_ = gtk_hbox_new(FALSE, 0);
219 gtk_container_add(GTK_CONTAINER(paint_box_), bookmark_hbox_); 195 gtk_container_add(GTK_CONTAINER(paint_box_), bookmark_hbox_);
220 196
221 instructions_ = gtk_alignment_new(0, 0, 1, 1); 197 instructions_ = gtk_alignment_new(0, 0, 1, 1);
222 gtk_alignment_set_padding(GTK_ALIGNMENT(instructions_), 0, 0, 198 gtk_alignment_set_padding(GTK_ALIGNMENT(instructions_), 0, 0,
223 kInstructionsPadding, 0); 199 kInstructionsPadding, 0);
200 Profile* profile = browser_->profile();
224 instructions_gtk_.reset(new BookmarkBarInstructionsGtk(this, profile)); 201 instructions_gtk_.reset(new BookmarkBarInstructionsGtk(this, profile));
225 gtk_container_add(GTK_CONTAINER(instructions_), instructions_gtk_->widget()); 202 gtk_container_add(GTK_CONTAINER(instructions_), instructions_gtk_->widget());
226 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_, 203 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_,
227 TRUE, TRUE, 0); 204 TRUE, TRUE, 0);
228 205
229 gtk_drag_dest_set(instructions_, 206 gtk_drag_dest_set(instructions_,
230 GtkDestDefaults(GTK_DEST_DEFAULT_DROP | GTK_DEST_DEFAULT_MOTION), 207 GtkDestDefaults(GTK_DEST_DEFAULT_DROP | GTK_DEST_DEFAULT_MOTION),
231 NULL, 0, kDragAction); 208 NULL, 0, kDragAction);
232 ui::SetDestTargetList(instructions_, kDestTargetList); 209 ui::SetDestTargetList(instructions_, kDestTargetList);
233 g_signal_connect(instructions_, "drag-data-received", 210 g_signal_connect(instructions_, "drag-data-received",
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_, 280 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_,
304 FALSE, FALSE, 0); 281 FALSE, FALSE, 0);
305 282
306 gtk_widget_set_size_request(event_box_.get(), -1, kBookmarkBarMinimumHeight); 283 gtk_widget_set_size_request(event_box_.get(), -1, kBookmarkBarMinimumHeight);
307 284
308 ViewIDUtil::SetID(other_bookmarks_button_, VIEW_ID_OTHER_BOOKMARKS); 285 ViewIDUtil::SetID(other_bookmarks_button_, VIEW_ID_OTHER_BOOKMARKS);
309 ViewIDUtil::SetID(widget(), VIEW_ID_BOOKMARK_BAR); 286 ViewIDUtil::SetID(widget(), VIEW_ID_BOOKMARK_BAR);
310 287
311 gtk_widget_show_all(widget()); 288 gtk_widget_show_all(widget());
312 gtk_widget_hide(widget()); 289 gtk_widget_hide(widget());
290
291 RemoveAllBookmarkButtons();
sky 2011/08/08 16:02:29 I don't think you need this anymore. It made sense
Peter Kasting 2011/08/08 17:52:07 Unfortunately this function does more than removin
292 // TODO(erg): Handle extensions
293 model_ = profile->GetBookmarkModel();
294 model_->AddObserver(this);
295 if (model_->IsLoaded())
296 Loaded(model_, false);
297 // else case: we'll receive notification back from the BookmarkModel when done
298 // loading, then we'll populate the bar.
313 } 299 }
314 300
315 void BookmarkBarGtk::SetBookmarkBarState( 301 void BookmarkBarGtk::SetBookmarkBarState(
316 BookmarkBar::State state, 302 BookmarkBar::State state,
317 BookmarkBar::AnimateChangeType animate_type) { 303 BookmarkBar::AnimateChangeType animate_type) {
318 if (animate_type == BookmarkBar::ANIMATE_STATE_CHANGE && 304 if (animate_type == BookmarkBar::ANIMATE_STATE_CHANGE &&
319 (state == BookmarkBar::DETACHED || 305 (state == BookmarkBar::DETACHED ||
320 bookmark_bar_state_ == BookmarkBar::DETACHED)) { 306 bookmark_bar_state_ == BookmarkBar::DETACHED)) {
321 // TODO(estade): animate the transition between detached and non or remove 307 // TODO(estade): animate the transition between detached and non or remove
322 // detached entirely. 308 // detached entirely.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 return; 377 return;
392 } else { 378 } else {
393 // Overflow exists: don't show anything for an overflowed folder button. 379 // Overflow exists: don't show anything for an overflowed folder button.
394 if (button != overflow_button_ && button != other_bookmarks_button_ && 380 if (button != overflow_button_ && button != other_bookmarks_button_ &&
395 node->parent()->GetIndexOf(node) >= first_hidden) { 381 node->parent()->GetIndexOf(node) >= first_hidden) {
396 return; 382 return;
397 } 383 }
398 } 384 }
399 385
400 current_menu_.reset( 386 current_menu_.reset(
401 new BookmarkMenuController(browser_, profile_, page_navigator_, 387 new BookmarkMenuController(browser_, browser_->profile(), page_navigator_,
402 GTK_WINDOW(gtk_widget_get_toplevel(button)), 388 GTK_WINDOW(gtk_widget_get_toplevel(button)),
403 node, 389 node,
404 button == overflow_button_ ? 390 button == overflow_button_ ?
405 first_hidden : 0)); 391 first_hidden : 0));
406 menu_bar_helper_.MenuStartedShowing(button, current_menu_->widget()); 392 menu_bar_helper_.MenuStartedShowing(button, current_menu_->widget());
407 GdkEvent* event = gtk_get_current_event(); 393 GdkEvent* event = gtk_get_current_event();
408 current_menu_->Popup(button, event->button.button, event->button.time); 394 current_menu_->Popup(button, event->button.button, event->button.time);
409 gdk_event_free(event); 395 gdk_event_free(event);
410 } 396 }
411 397
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 nodes.push_back(node); 1098 nodes.push_back(node);
1113 parent = node->parent(); 1099 parent = node->parent();
1114 } else { 1100 } else {
1115 parent = model_->bookmark_bar_node(); 1101 parent = model_->bookmark_bar_node();
1116 nodes.push_back(parent); 1102 nodes.push_back(parent);
1117 } 1103 }
1118 1104
1119 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender)); 1105 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender));
1120 current_context_menu_controller_.reset( 1106 current_context_menu_controller_.reset(
1121 new BookmarkContextMenuController( 1107 new BookmarkContextMenuController(
1122 window, this, profile_, page_navigator_, parent, nodes)); 1108 window, this, browser_->profile(), page_navigator_, parent, nodes));
1123 current_context_menu_.reset( 1109 current_context_menu_.reset(
1124 new MenuGtk(NULL, current_context_menu_controller_->menu_model())); 1110 new MenuGtk(NULL, current_context_menu_controller_->menu_model()));
1125 current_context_menu_->PopupAsContext( 1111 current_context_menu_->PopupAsContext(
1126 gfx::Point(event->x_root, event->y_root), 1112 gfx::Point(event->x_root, event->y_root),
1127 event->time); 1113 event->time);
1128 } 1114 }
1129 1115
1130 gboolean BookmarkBarGtk::OnButtonPressed(GtkWidget* sender, 1116 gboolean BookmarkBarGtk::OnButtonPressed(GtkWidget* sender,
1131 GdkEventButton* event) { 1117 GdkEventButton* event) {
1132 last_pressed_coordinates_ = gfx::Point(event->x, event->y); 1118 last_pressed_coordinates_ = gfx::Point(event->x, event->y);
(...skipping 17 matching lines...) Expand all
1150 1136
1151 return FALSE; 1137 return FALSE;
1152 } 1138 }
1153 1139
1154 void BookmarkBarGtk::OnClicked(GtkWidget* sender) { 1140 void BookmarkBarGtk::OnClicked(GtkWidget* sender) {
1155 const BookmarkNode* node = GetNodeForToolButton(sender); 1141 const BookmarkNode* node = GetNodeForToolButton(sender);
1156 DCHECK(node); 1142 DCHECK(node);
1157 DCHECK(node->is_url()); 1143 DCHECK(node->is_url());
1158 DCHECK(page_navigator_); 1144 DCHECK(page_navigator_);
1159 1145
1160 RecordAppLaunch(profile_, node->url()); 1146 Profile* profile = browser_->profile();
1161 bookmark_utils::OpenAll(window_->GetNativeHandle(), 1147 RecordAppLaunch(profile, node->url());
1162 profile_, page_navigator_, node, 1148 bookmark_utils::OpenAll(window_->GetNativeHandle(), profile, page_navigator_,
1163 gtk_util::DispositionForCurrentButtonPressEvent()); 1149 node, gtk_util::DispositionForCurrentButtonPressEvent());
1164 1150
1165 UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton")); 1151 UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"));
1166 } 1152 }
1167 1153
1168 void BookmarkBarGtk::OnButtonDragBegin(GtkWidget* button, 1154 void BookmarkBarGtk::OnButtonDragBegin(GtkWidget* button,
1169 GdkDragContext* drag_context) { 1155 GdkDragContext* drag_context) {
1170 // The parent tool item might be removed during the drag. Ref it so |button| 1156 // The parent tool item might be removed during the drag. Ref it so |button|
1171 // won't get destroyed. 1157 // won't get destroyed.
1172 g_object_ref(button->parent); 1158 g_object_ref(button->parent);
1173 1159
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 DCHECK(dragged_node_); 1199 DCHECK(dragged_node_);
1214 dragged_node_ = NULL; 1200 dragged_node_ = NULL;
1215 1201
1216 DCHECK(drag_icon_); 1202 DCHECK(drag_icon_);
1217 gtk_widget_destroy(drag_icon_); 1203 gtk_widget_destroy(drag_icon_);
1218 drag_icon_ = NULL; 1204 drag_icon_ = NULL;
1219 1205
1220 g_object_unref(button->parent); 1206 g_object_unref(button->parent);
1221 } 1207 }
1222 1208
1223 void BookmarkBarGtk::OnButtonDragGet(GtkWidget* widget, GdkDragContext* context, 1209 void BookmarkBarGtk::OnButtonDragGet(GtkWidget* widget,
1210 GdkDragContext* context,
1224 GtkSelectionData* selection_data, 1211 GtkSelectionData* selection_data,
1225 guint target_type, guint time) { 1212 guint target_type,
1213 guint time) {
1226 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget); 1214 const BookmarkNode* node = bookmark_utils::BookmarkNodeForWidget(widget);
1227 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type, 1215 bookmark_utils::WriteBookmarkToSelection(node, selection_data, target_type,
1228 profile_); 1216 browser_->profile());
1229 } 1217 }
1230 1218
1231 void BookmarkBarGtk::OnFolderClicked(GtkWidget* sender) { 1219 void BookmarkBarGtk::OnFolderClicked(GtkWidget* sender) {
1232 // Stop its throbbing, if any. 1220 // Stop its throbbing, if any.
1233 HoverControllerGtk* hover_controller = 1221 HoverControllerGtk* hover_controller =
1234 HoverControllerGtk::GetHoverControllerGtk(sender); 1222 HoverControllerGtk::GetHoverControllerGtk(sender);
1235 if (hover_controller) 1223 if (hover_controller)
1236 hover_controller->StartThrobbing(0); 1224 hover_controller->StartThrobbing(0);
1237 1225
1238 GdkEvent* event = gtk_get_current_event(); 1226 GdkEvent* event = gtk_get_current_event();
1239 if (event->button.button == 1) { 1227 if (event->button.button == 1) {
1240 PopupForButton(sender); 1228 PopupForButton(sender);
1241 } else if (event->button.button == 2) { 1229 } else if (event->button.button == 2) {
1242 const BookmarkNode* node = GetNodeForToolButton(sender); 1230 const BookmarkNode* node = GetNodeForToolButton(sender);
1243 bookmark_utils::OpenAll(window_->GetNativeHandle(), 1231 bookmark_utils::OpenAll(window_->GetNativeHandle(), browser_->profile(),
1244 profile_, page_navigator_, 1232 page_navigator_, node, NEW_BACKGROUND_TAB);
1245 node, NEW_BACKGROUND_TAB);
1246 } 1233 }
1247 } 1234 }
1248 1235
1249 gboolean BookmarkBarGtk::OnToolbarDragMotion(GtkWidget* toolbar, 1236 gboolean BookmarkBarGtk::OnToolbarDragMotion(GtkWidget* toolbar,
1250 GdkDragContext* context, 1237 GdkDragContext* context,
1251 gint x, 1238 gint x,
1252 gint y, 1239 gint y,
1253 guint time) { 1240 guint time) {
1254 gint index = gtk_toolbar_get_drop_index(GTK_TOOLBAR(toolbar), x, y); 1241 gint index = gtk_toolbar_get_drop_index(GTK_TOOLBAR(toolbar), x, y);
1255 return ItemDraggedOverToolbar(context, index, time); 1242 return ItemDraggedOverToolbar(context, index, time);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 dest_node = GetNodeForToolButton(widget); 1284 dest_node = GetNodeForToolButton(widget);
1298 index = dest_node->child_count(); 1285 index = dest_node->child_count();
1299 } 1286 }
1300 } 1287 }
1301 1288
1302 switch (target_type) { 1289 switch (target_type) {
1303 case ui::CHROME_BOOKMARK_ITEM: { 1290 case ui::CHROME_BOOKMARK_ITEM: {
1304 std::vector<const BookmarkNode*> nodes = 1291 std::vector<const BookmarkNode*> nodes =
1305 bookmark_utils::GetNodesFromSelection(context, selection_data, 1292 bookmark_utils::GetNodesFromSelection(context, selection_data,
1306 target_type, 1293 target_type,
1307 profile_, 1294 browser_->profile(),
1308 &delete_selection_data, 1295 &delete_selection_data,
1309 &dnd_success); 1296 &dnd_success);
1310 DCHECK(!nodes.empty()); 1297 DCHECK(!nodes.empty());
1311 for (std::vector<const BookmarkNode*>::iterator it = nodes.begin(); 1298 for (std::vector<const BookmarkNode*>::iterator it = nodes.begin();
1312 it != nodes.end(); ++it) { 1299 it != nodes.end(); ++it) {
1313 model_->Move(*it, dest_node, index); 1300 model_->Move(*it, dest_node, index);
1314 index = dest_node->GetIndexOf(*it) + 1; 1301 index = dest_node->GetIndexOf(*it) + 1;
1315 } 1302 }
1316 break; 1303 break;
1317 } 1304 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { 1458 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() {
1472 GtkDestDefaults dest_defaults = 1459 GtkDestDefaults dest_defaults =
1473 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : 1460 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL :
1474 GTK_DEST_DEFAULT_DROP; 1461 GTK_DEST_DEFAULT_DROP;
1475 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); 1462 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction);
1476 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, 1463 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults,
1477 NULL, 0, kDragAction); 1464 NULL, 0, kDragAction);
1478 ui::SetDestTargetList(overflow_button_, kDestTargetList); 1465 ui::SetDestTargetList(overflow_button_, kDestTargetList);
1479 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); 1466 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList);
1480 } 1467 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698