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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 // Base class for non-menu hosting buttons used on the bookmark bar. | 200 // Base class for non-menu hosting buttons used on the bookmark bar. |
201 | 201 |
202 class BookmarkButtonBase : public views::LabelButton { | 202 class BookmarkButtonBase : public views::LabelButton { |
203 public: | 203 public: |
204 BookmarkButtonBase(views::ButtonListener* listener, | 204 BookmarkButtonBase(views::ButtonListener* listener, |
205 const base::string16& title) | 205 const base::string16& title) |
206 : LabelButton(listener, title) { | 206 : LabelButton(listener, title) { |
207 SetElideBehavior(kElideBehavior); | 207 SetElideBehavior(kElideBehavior); |
208 if (ui::MaterialDesignController::IsModeMaterial()) { | 208 if (ui::MaterialDesignController::IsModeMaterial()) { |
209 SetHasInkDrop(true); | 209 SetInkDropMode(InkDropMode::ON); |
210 set_has_ink_drop_action_on_click(true); | 210 set_has_ink_drop_action_on_click(true); |
211 SetFocusPainter(nullptr); | 211 SetFocusPainter(nullptr); |
212 } | 212 } |
213 show_animation_.reset(new gfx::SlideAnimation(this)); | 213 show_animation_.reset(new gfx::SlideAnimation(this)); |
214 if (!animations_enabled) { | 214 if (!animations_enabled) { |
215 // For some reason during testing the events generated by animating | 215 // For some reason during testing the events generated by animating |
216 // throw off the test. So, don't animate while testing. | 216 // throw off the test. So, don't animate while testing. |
217 show_animation_->Reset(1); | 217 show_animation_->Reset(1); |
218 } else { | 218 } else { |
219 show_animation_->Show(); | 219 show_animation_->Show(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 // BookmarkMenuButtonBase ----------------------------------------------------- | 329 // BookmarkMenuButtonBase ----------------------------------------------------- |
330 | 330 |
331 // Base class for menu hosting buttons used on the bookmark bar. | 331 // Base class for menu hosting buttons used on the bookmark bar. |
332 class BookmarkMenuButtonBase : public views::MenuButton { | 332 class BookmarkMenuButtonBase : public views::MenuButton { |
333 public: | 333 public: |
334 BookmarkMenuButtonBase(const base::string16& title, | 334 BookmarkMenuButtonBase(const base::string16& title, |
335 views::MenuButtonListener* menu_button_listener, | 335 views::MenuButtonListener* menu_button_listener, |
336 bool show_menu_marker) | 336 bool show_menu_marker) |
337 : MenuButton(title, menu_button_listener, show_menu_marker) { | 337 : MenuButton(title, menu_button_listener, show_menu_marker) { |
338 SetHasInkDrop(ui::MaterialDesignController::IsModeMaterial()); | 338 if (ui::MaterialDesignController::IsModeMaterial()) { |
339 if (ui::MaterialDesignController::IsModeMaterial()) | 339 SetInkDropMode(InkDropMode::ON); |
340 SetFocusPainter(nullptr); | 340 SetFocusPainter(nullptr); |
| 341 } |
341 } | 342 } |
342 | 343 |
343 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { | 344 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { |
344 return base::WrapUnique(new views::FloodFillInkDropRipple( | 345 return base::WrapUnique(new views::FloodFillInkDropRipple( |
345 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), | 346 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), |
346 GetInkDropBaseColor(), ink_drop_visible_opacity())); | 347 GetInkDropBaseColor(), ink_drop_visible_opacity())); |
347 } | 348 } |
348 | 349 |
349 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 350 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
350 const override { | 351 const override { |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 return; | 2162 return; |
2162 apps_page_shortcut_->SetVisible(visible); | 2163 apps_page_shortcut_->SetVisible(visible); |
2163 UpdateBookmarksSeparatorVisibility(); | 2164 UpdateBookmarksSeparatorVisibility(); |
2164 LayoutAndPaint(); | 2165 LayoutAndPaint(); |
2165 } | 2166 } |
2166 | 2167 |
2167 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2168 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2168 if (UpdateOtherAndManagedButtonsVisibility()) | 2169 if (UpdateOtherAndManagedButtonsVisibility()) |
2169 LayoutAndPaint(); | 2170 LayoutAndPaint(); |
2170 } | 2171 } |
OLD | NEW |