OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
17 #include "chrome/browser/bookmarks/bookmark_node_data.h" | 17 #include "chrome/browser/bookmarks/bookmark_node_data.h" |
18 #include "chrome/browser/bookmarks/bookmark_stats.h" | 18 #include "chrome/browser/bookmarks/bookmark_stats.h" |
19 #include "chrome/browser/browser_shutdown.h" | |
20 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/themes/theme_properties.h" | 22 #include "chrome/browser/themes/theme_properties.h" |
24 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" | 23 #include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h" |
25 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" | 24 #include "chrome/browser/ui/bookmarks/bookmark_drag_drop.h" |
26 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 25 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
27 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
28 #include "chrome/browser/ui/chrome_pages.h" | 27 #include "chrome/browser/ui/chrome_pages.h" |
29 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h" | 28 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h" |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 if (!instructions_) | 885 if (!instructions_) |
887 return; | 886 return; |
888 | 887 |
889 UpdateOtherBookmarksVisibility(); | 888 UpdateOtherBookmarksVisibility(); |
890 ResetButtons(); | 889 ResetButtons(); |
891 } | 890 } |
892 | 891 |
893 void BookmarkBarGtk::BookmarkModelBeingDeleted(BookmarkModel* model) { | 892 void BookmarkBarGtk::BookmarkModelBeingDeleted(BookmarkModel* model) { |
894 // The bookmark model should never be deleted before us. This code exists | 893 // The bookmark model should never be deleted before us. This code exists |
895 // to check for regressions in shutdown code and not crash. | 894 // to check for regressions in shutdown code and not crash. |
896 if (!browser_shutdown::ShuttingDownWithoutClosingBrowsers()) | 895 NOTREACHED(); |
897 NOTREACHED(); | |
898 | 896 |
899 // Do minimal cleanup, presumably we'll be deleted shortly. | 897 // Do minimal cleanup, presumably we'll be deleted shortly. |
900 model_->RemoveObserver(this); | 898 model_->RemoveObserver(this); |
901 model_ = NULL; | 899 model_ = NULL; |
902 } | 900 } |
903 | 901 |
904 void BookmarkBarGtk::BookmarkNodeMoved(BookmarkModel* model, | 902 void BookmarkBarGtk::BookmarkNodeMoved(BookmarkModel* model, |
905 const BookmarkNode* old_parent, | 903 const BookmarkNode* old_parent, |
906 int old_index, | 904 int old_index, |
907 const BookmarkNode* new_parent, | 905 const BookmarkNode* new_parent, |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { | 1508 void BookmarkBarGtk::OnEditBookmarksEnabledChanged() { |
1511 GtkDestDefaults dest_defaults = | 1509 GtkDestDefaults dest_defaults = |
1512 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : | 1510 *edit_bookmarks_enabled_ ? GTK_DEST_DEFAULT_ALL : |
1513 GTK_DEST_DEFAULT_DROP; | 1511 GTK_DEST_DEFAULT_DROP; |
1514 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); | 1512 gtk_drag_dest_set(overflow_button_, dest_defaults, NULL, 0, kDragAction); |
1515 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, | 1513 gtk_drag_dest_set(other_bookmarks_button_, dest_defaults, |
1516 NULL, 0, kDragAction); | 1514 NULL, 0, kDragAction); |
1517 ui::SetDestTargetList(overflow_button_, kDestTargetList); | 1515 ui::SetDestTargetList(overflow_button_, kDestTargetList); |
1518 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); | 1516 ui::SetDestTargetList(other_bookmarks_button_, kDestTargetList); |
1519 } | 1517 } |
OLD | NEW |