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/views/bookmarks/bookmark_bar_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 | 1654 |
1655 bookmarks_separator_view_ = new ButtonSeparatorView(); | 1655 bookmarks_separator_view_ = new ButtonSeparatorView(); |
1656 AddChildView(bookmarks_separator_view_); | 1656 AddChildView(bookmarks_separator_view_); |
1657 UpdateBookmarksSeparatorVisibility(); | 1657 UpdateBookmarksSeparatorVisibility(); |
1658 | 1658 |
1659 instructions_ = new BookmarkBarInstructionsView(this); | 1659 instructions_ = new BookmarkBarInstructionsView(this); |
1660 AddChildView(instructions_); | 1660 AddChildView(instructions_); |
1661 | 1661 |
1662 set_context_menu_controller(this); | 1662 set_context_menu_controller(this); |
1663 | 1663 |
1664 model_ = BookmarkModelFactory::GetForProfile(browser_->profile()); | 1664 model_ = BookmarkModelFactory::GetForBrowserContext(browser_->profile()); |
1665 managed_ = ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); | 1665 managed_ = ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); |
1666 if (model_) { | 1666 if (model_) { |
1667 model_->AddObserver(this); | 1667 model_->AddObserver(this); |
1668 if (model_->loaded()) | 1668 if (model_->loaded()) |
1669 BookmarkModelLoaded(model_, false); | 1669 BookmarkModelLoaded(model_, false); |
1670 // else case: we'll receive notification back from the BookmarkModel when | 1670 // else case: we'll receive notification back from the BookmarkModel when |
1671 // done loading, then we'll populate the bar. | 1671 // done loading, then we'll populate the bar. |
1672 } | 1672 } |
1673 } | 1673 } |
1674 | 1674 |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 return; | 2174 return; |
2175 apps_page_shortcut_->SetVisible(visible); | 2175 apps_page_shortcut_->SetVisible(visible); |
2176 UpdateBookmarksSeparatorVisibility(); | 2176 UpdateBookmarksSeparatorVisibility(); |
2177 LayoutAndPaint(); | 2177 LayoutAndPaint(); |
2178 } | 2178 } |
2179 | 2179 |
2180 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2180 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2181 if (UpdateOtherAndManagedButtonsVisibility()) | 2181 if (UpdateOtherAndManagedButtonsVisibility()) |
2182 LayoutAndPaint(); | 2182 LayoutAndPaint(); |
2183 } | 2183 } |
OLD | NEW |