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

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

Issue 677533003: Changes BookmarkBarView to only create buttons as needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: integrate feedback Created 6 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 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Creates recent bookmark button and when visible button as well as 278 // Creates recent bookmark button and when visible button as well as
279 // calculating the preferred height. 279 // calculating the preferred height.
280 void Init(); 280 void Init();
281 281
282 // NOTE: unless otherwise stated all methods that take an int for an index are 282 // NOTE: unless otherwise stated all methods that take an int for an index are
283 // in terms of the bookmark bar view. Typically the view index and model index 283 // in terms of the bookmark bar view. Typically the view index and model index
284 // are the same, but they may differ during animations or drag and drop. 284 // are the same, but they may differ during animations or drag and drop.
285 // 285 //
286 // It's easy to get the mapping wrong. For this reason all these methods are 286 // It's easy to get the mapping wrong. For this reason all these methods are
287 // private. 287 // private.
288 288 //
msw 2014/10/27 22:50:18 I don't think these two comment blocks should be j
sky 2014/10/27 23:00:49 Done.
msw 2014/10/27 23:06:00 nit: (still joined)
sky 2014/10/27 23:13:58 GAH! Sorry, misunderstood your comment. fixed.
289 // Returns the number of buttons corresponding to starred urls/folders. This 289 // Returns the number of buttons corresponding to starred urls/folders.
290 // is equivalent to the number of children the bookmark bar node from the 290 // Buttons
msw 2014/10/27 22:50:18 What? Fix this sentence of the comment. Overall, I
sky 2014/10/27 23:00:49 Done.
291 // bookmark bar model has. 291 // are lazily as necessary to fill available space. As such, the return value
292 // is often times less than that of the model.
292 int GetBookmarkButtonCount() const; 293 int GetBookmarkButtonCount() const;
293 294
294 // Returns the button at the specified index. 295 // Returns the button at the specified index.
295 views::LabelButton* GetBookmarkButton(int index); 296 views::LabelButton* GetBookmarkButton(int index);
296 297
297 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or 298 // Returns BOOKMARK_LAUNCH_LOCATION_DETACHED_BAR or
298 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state. 299 // BOOKMARK_LAUNCH_LOCATION_ATTACHED_BAR based on detached state.
299 BookmarkLaunchLocation GetBookmarkLaunchLocation() const; 300 BookmarkLaunchLocation GetBookmarkLaunchLocation() const;
300 301
301 // Returns the index of the first hidden bookmark button. If all buttons are 302 // Returns the index of the first hidden bookmark button. If all buttons are
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 458
458 ObserverList<BookmarkBarViewObserver> observers_; 459 ObserverList<BookmarkBarViewObserver> observers_;
459 460
460 // Factory used to delay showing of the drop menu. 461 // Factory used to delay showing of the drop menu.
461 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; 462 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_;
462 463
463 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); 464 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView);
464 }; 465 };
465 466
466 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ 467 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698