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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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
OLDNEW
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 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 base::Bind(&BookmarkBarView::OnShowManagedBookmarksPrefChanged, 1588 base::Bind(&BookmarkBarView::OnShowManagedBookmarksPrefChanged,
1589 base::Unretained(this))); 1589 base::Unretained(this)));
1590 apps_page_shortcut_->SetVisible( 1590 apps_page_shortcut_->SetVisible(
1591 chrome::ShouldShowAppsShortcutInBookmarkBar(browser_->profile())); 1591 chrome::ShouldShowAppsShortcutInBookmarkBar(browser_->profile()));
1592 1592
1593 bookmarks_separator_view_ = new ButtonSeparatorView(); 1593 bookmarks_separator_view_ = new ButtonSeparatorView();
1594 AddChildView(bookmarks_separator_view_); 1594 AddChildView(bookmarks_separator_view_);
1595 UpdateBookmarksSeparatorVisibility(); 1595 UpdateBookmarksSeparatorVisibility();
1596 1596
1597 instructions_ = new BookmarkBarInstructionsView(this); 1597 instructions_ = new BookmarkBarInstructionsView(this);
1598 instructions_->SetBorder(views::Border::CreateEmptyBorder( 1598 instructions_->SetBorder(views::CreateEmptyBorder(kButtonPaddingVertical, 0,
1599 kButtonPaddingVertical, 0, kButtonPaddingVertical, 0)); 1599 kButtonPaddingVertical, 0));
1600 AddChildView(instructions_); 1600 AddChildView(instructions_);
1601 1601
1602 set_context_menu_controller(this); 1602 set_context_menu_controller(this);
1603 1603
1604 model_ = BookmarkModelFactory::GetForBrowserContext(browser_->profile()); 1604 model_ = BookmarkModelFactory::GetForBrowserContext(browser_->profile());
1605 managed_ = ManagedBookmarkServiceFactory::GetForProfile(browser_->profile()); 1605 managed_ = ManagedBookmarkServiceFactory::GetForProfile(browser_->profile());
1606 if (model_) { 1606 if (model_) {
1607 model_->AddObserver(this); 1607 model_->AddObserver(this);
1608 if (model_->loaded()) 1608 if (model_->loaded())
1609 BookmarkModelLoaded(model_, false); 1609 BookmarkModelLoaded(model_, false);
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2114 return; 2114 return;
2115 apps_page_shortcut_->SetVisible(visible); 2115 apps_page_shortcut_->SetVisible(visible);
2116 UpdateBookmarksSeparatorVisibility(); 2116 UpdateBookmarksSeparatorVisibility();
2117 LayoutAndPaint(); 2117 LayoutAndPaint();
2118 } 2118 }
2119 2119
2120 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { 2120 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() {
2121 if (UpdateOtherAndManagedButtonsVisibility()) 2121 if (UpdateOtherAndManagedButtonsVisibility())
2122 LayoutAndPaint(); 2122 LayoutAndPaint();
2123 } 2123 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/save_card_bubble_views.cc ('k') | chrome/browser/ui/views/collected_cookies_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698