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

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

Issue 2524773002: Update the bookmark tooltip text only when necessary (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 26 matching lines...) Expand all
37 37
38 namespace bookmarks { 38 namespace bookmarks {
39 class BookmarkModel; 39 class BookmarkModel;
40 class ManagedBookmarkService; 40 class ManagedBookmarkService;
41 } 41 }
42 42
43 namespace content { 43 namespace content {
44 class PageNavigator; 44 class PageNavigator;
45 } 45 }
46 46
47 namespace gfx {
48 class FontList;
49 }
50
47 namespace views { 51 namespace views {
48 class CustomButton; 52 class CustomButton;
49 class MenuButton; 53 class MenuButton;
50 class MenuItemView; 54 class MenuItemView;
51 class LabelButton; 55 class LabelButton;
52 } 56 }
53 57
54 // BookmarkBarView renders the BookmarkModel. Each starred entry on the 58 // BookmarkBarView renders the BookmarkModel. Each starred entry on the
55 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to 59 // BookmarkBar is rendered as a MenuButton. An additional MenuButton aligned to
56 // the right allows the user to quickly see recently starred entries. 60 // the right allows the user to quickly see recently starred entries.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 139
136 // Returns the drop MenuItemView, or NULL if a menu isn't showing. 140 // Returns the drop MenuItemView, or NULL if a menu isn't showing.
137 views::MenuItemView* GetDropMenu(); 141 views::MenuItemView* GetDropMenu();
138 142
139 // If a button is currently throbbing, it is stopped. If immediate is true 143 // If a button is currently throbbing, it is stopped. If immediate is true
140 // the throb stops immediately, otherwise it stops after a couple more 144 // the throb stops immediately, otherwise it stops after a couple more
141 // throbs. 145 // throbs.
142 void StopThrobbing(bool immediate); 146 void StopThrobbing(bool immediate);
143 147
144 // Returns the tooltip text for the specified url and title. The returned 148 // Returns the tooltip text for the specified url and title. The returned
145 // text is clipped to fit within the bounds of the monitor. |context| is 149 // text is clipped to fit |max_tooltip_width|.
146 // used to determine which display::Screen is used to retrieve bounds.
147 // 150 //
148 // Note that we adjust the direction of both the URL and the title based on 151 // Note that we adjust the direction of both the URL and the title based on
149 // the locale so that pure LTR strings are displayed properly in RTL locales. 152 // the locale so that pure LTR strings are displayed properly in RTL locales.
150 static base::string16 CreateToolTipForURLAndTitle(const views::Widget* widget, 153 static base::string16 CreateToolTipForURLAndTitle(
151 const gfx::Point& screen_loc, 154 int max_tooltip_width,
152 const GURL& url, 155 const gfx::FontList& font_list,
153 const base::string16& title); 156 const GURL& url,
157 const base::string16& title);
154 158
155 // Returns true if Bookmarks Bar is currently detached from the Toolbar. 159 // Returns true if Bookmarks Bar is currently detached from the Toolbar.
156 bool IsDetached() const; 160 bool IsDetached() const;
157 161
158 // Returns the current amount of overlap atop the browser toolbar. 162 // Returns the current amount of overlap atop the browser toolbar.
159 int GetToolbarOverlap() const; 163 int GetToolbarOverlap() const;
160 164
161 // views::View: 165 // views::View:
162 gfx::Size GetPreferredSize() const override; 166 gfx::Size GetPreferredSize() const override;
163 gfx::Size GetMinimumSize() const override; 167 gfx::Size GetMinimumSize() const override;
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 462
459 base::ObserverList<BookmarkBarViewObserver> observers_; 463 base::ObserverList<BookmarkBarViewObserver> observers_;
460 464
461 // Factory used to delay showing of the drop menu. 465 // Factory used to delay showing of the drop menu.
462 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_; 466 base::WeakPtrFactory<BookmarkBarView> show_folder_method_factory_;
463 467
464 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); 468 DISALLOW_COPY_AND_ASSIGN(BookmarkBarView);
465 }; 469 };
466 470
467 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_ 471 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BAR_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698