| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 SkColor GetInkDropBaseColor() const override { | 245 SkColor GetInkDropBaseColor() const override { |
| 246 return GetThemeProvider()->GetColor( | 246 return GetThemeProvider()->GetColor( |
| 247 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); | 247 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
| 248 } | 248 } |
| 249 | 249 |
| 250 private: | 250 private: |
| 251 std::unique_ptr<gfx::SlideAnimation> show_animation_; | 251 std::unique_ptr<gfx::SlideAnimation> show_animation_; |
| 252 | 252 |
| 253 | |
| 254 DISALLOW_COPY_AND_ASSIGN(BookmarkButtonBase); | 253 DISALLOW_COPY_AND_ASSIGN(BookmarkButtonBase); |
| 255 }; | 254 }; |
| 256 | 255 |
| 257 // BookmarkButton ------------------------------------------------------------- | 256 // BookmarkButton ------------------------------------------------------------- |
| 258 | 257 |
| 259 // Buttons used for the bookmarks on the bookmark bar. | 258 // Buttons used for the bookmarks on the bookmark bar. |
| 260 | 259 |
| 261 class BookmarkButton : public BookmarkButtonBase { | 260 class BookmarkButton : public BookmarkButtonBase { |
| 262 public: | 261 public: |
| 263 // The internal view class name. | 262 // The internal view class name. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 282 max_tooltip_width_ = max_tooltip_width; | 281 max_tooltip_width_ = max_tooltip_width; |
| 283 tooltip_text_ = BookmarkBarView::CreateToolTipForURLAndTitle( | 282 tooltip_text_ = BookmarkBarView::CreateToolTipForURLAndTitle( |
| 284 max_tooltip_width_, tooltip_manager->GetFontList(), url_, GetText()); | 283 max_tooltip_width_, tooltip_manager->GetFontList(), url_, GetText()); |
| 285 } | 284 } |
| 286 *tooltip_text = tooltip_text_; | 285 *tooltip_text = tooltip_text_; |
| 287 return !tooltip_text->empty(); | 286 return !tooltip_text->empty(); |
| 288 } | 287 } |
| 289 | 288 |
| 290 void SetText(const base::string16& text) override { | 289 void SetText(const base::string16& text) override { |
| 291 BookmarkButtonBase::SetText(text); | 290 BookmarkButtonBase::SetText(text); |
| 292 tooltip_text_.empty(); | 291 tooltip_text_.clear(); |
| 293 } | 292 } |
| 294 | 293 |
| 295 const char* GetClassName() const override { return kViewClassName; } | 294 const char* GetClassName() const override { return kViewClassName; } |
| 296 | 295 |
| 297 private: | 296 private: |
| 298 // A cached value of maximum width for tooltip to skip generating | 297 // A cached value of maximum width for tooltip to skip generating |
| 299 // new tooltip text. | 298 // new tooltip text. |
| 300 mutable int max_tooltip_width_ = 0; | 299 mutable int max_tooltip_width_ = 0; |
| 301 mutable base::string16 tooltip_text_; | 300 mutable base::string16 tooltip_text_; |
| 302 const GURL& url_; | 301 const GURL& url_; |
| (...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 return; | 2147 return; |
| 2149 apps_page_shortcut_->SetVisible(visible); | 2148 apps_page_shortcut_->SetVisible(visible); |
| 2150 UpdateBookmarksSeparatorVisibility(); | 2149 UpdateBookmarksSeparatorVisibility(); |
| 2151 LayoutAndPaint(); | 2150 LayoutAndPaint(); |
| 2152 } | 2151 } |
| 2153 | 2152 |
| 2154 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2153 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2155 if (UpdateOtherAndManagedButtonsVisibility()) | 2154 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2156 LayoutAndPaint(); | 2155 LayoutAndPaint(); |
| 2157 } | 2156 } |
| OLD | NEW |