OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 393 |
394 bool BookmarkBarGtk::IsAnimating() { | 394 bool BookmarkBarGtk::IsAnimating() { |
395 return slide_animation_->is_animating(); | 395 return slide_animation_->is_animating(); |
396 } | 396 } |
397 | 397 |
398 bool BookmarkBarGtk::OnNewTabPage() { | 398 bool BookmarkBarGtk::OnNewTabPage() { |
399 return (browser_ && browser_->GetSelectedTabContents() && | 399 return (browser_ && browser_->GetSelectedTabContents() && |
400 browser_->GetSelectedTabContents()->ShouldShowBookmarkBar()); | 400 browser_->GetSelectedTabContents()->ShouldShowBookmarkBar()); |
401 } | 401 } |
402 | 402 |
403 bool BookmarkBarGtk::OnAppsPage() const { | |
404 return (browser_ && browser_->GetSelectedTabContents() && | |
405 browser_->GetSelectedTabContents()->is_app()); | |
406 } | |
407 | |
408 void BookmarkBarGtk::Loaded(BookmarkModel* model) { | 403 void BookmarkBarGtk::Loaded(BookmarkModel* model) { |
409 // If |instructions_| has been nulled, we are in the middle of browser | 404 // If |instructions_| has been nulled, we are in the middle of browser |
410 // shutdown. Do nothing. | 405 // shutdown. Do nothing. |
411 if (!instructions_) | 406 if (!instructions_) |
412 return; | 407 return; |
413 | 408 |
414 RemoveAllBookmarkButtons(); | 409 RemoveAllBookmarkButtons(); |
415 CreateAllBookmarkButtons(); | 410 CreateAllBookmarkButtons(); |
416 } | 411 } |
417 | 412 |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 | 1360 |
1366 // Find the GtkWidget* for the actual target button. | 1361 // Find the GtkWidget* for the actual target button. |
1367 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; | 1362 int shift = dir == GTK_MENU_DIR_PARENT ? -1 : 1; |
1368 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); | 1363 button_idx = (button_idx + shift + folder_list.size()) % folder_list.size(); |
1369 PopupForButton(folder_list[button_idx]); | 1364 PopupForButton(folder_list[button_idx]); |
1370 } | 1365 } |
1371 | 1366 |
1372 void BookmarkBarGtk::CloseMenu() { | 1367 void BookmarkBarGtk::CloseMenu() { |
1373 current_context_menu_->Cancel(); | 1368 current_context_menu_->Cancel(); |
1374 } | 1369 } |
OLD | NEW |