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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // BookmarkButtonBase ----------------------------------------------- | 198 // BookmarkButtonBase ----------------------------------------------- |
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 SetHasInkDrop(ui::MaterialDesignController::IsModeMaterial()); | 208 if (ui::MaterialDesignController::IsModeMaterial()) |
| 209 SetHasInkDrop(INK_DROP_WITH_GESTURE_HANDLING); |
209 set_has_ink_drop_action_on_click(true); | 210 set_has_ink_drop_action_on_click(true); |
210 show_animation_.reset(new gfx::SlideAnimation(this)); | 211 show_animation_.reset(new gfx::SlideAnimation(this)); |
211 if (!animations_enabled) { | 212 if (!animations_enabled) { |
212 // For some reason during testing the events generated by animating | 213 // For some reason during testing the events generated by animating |
213 // throw off the test. So, don't animate while testing. | 214 // throw off the test. So, don't animate while testing. |
214 show_animation_->Reset(1); | 215 show_animation_->Reset(1); |
215 } else { | 216 } else { |
216 show_animation_->Show(); | 217 show_animation_->Show(); |
217 } | 218 } |
218 } | 219 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 325 |
325 // BookmarkMenuButtonBase ----------------------------------------------------- | 326 // BookmarkMenuButtonBase ----------------------------------------------------- |
326 | 327 |
327 // Base class for menu hosting buttons used on the bookmark bar. | 328 // Base class for menu hosting buttons used on the bookmark bar. |
328 class BookmarkMenuButtonBase : public views::MenuButton { | 329 class BookmarkMenuButtonBase : public views::MenuButton { |
329 public: | 330 public: |
330 BookmarkMenuButtonBase(const base::string16& title, | 331 BookmarkMenuButtonBase(const base::string16& title, |
331 views::MenuButtonListener* menu_button_listener, | 332 views::MenuButtonListener* menu_button_listener, |
332 bool show_menu_marker) | 333 bool show_menu_marker) |
333 : MenuButton(title, menu_button_listener, show_menu_marker) { | 334 : MenuButton(title, menu_button_listener, show_menu_marker) { |
334 SetHasInkDrop(ui::MaterialDesignController::IsModeMaterial()); | 335 if (ui::MaterialDesignController::IsModeMaterial()) |
| 336 SetHasInkDrop(INK_DROP_WITH_GESTURE_HANDLING); |
335 } | 337 } |
336 | 338 |
337 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { | 339 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override { |
338 return base::WrapUnique(new views::FloodFillInkDropRipple( | 340 return base::WrapUnique(new views::FloodFillInkDropRipple( |
339 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), | 341 CalculateInkDropBounds(size()), GetInkDropCenterBasedOnLastEvent(), |
340 GetInkDropBaseColor(), ink_drop_visible_opacity())); | 342 GetInkDropBaseColor(), ink_drop_visible_opacity())); |
341 } | 343 } |
342 | 344 |
343 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 345 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
344 const override { | 346 const override { |
(...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 return; | 2156 return; |
2155 apps_page_shortcut_->SetVisible(visible); | 2157 apps_page_shortcut_->SetVisible(visible); |
2156 UpdateBookmarksSeparatorVisibility(); | 2158 UpdateBookmarksSeparatorVisibility(); |
2157 LayoutAndPaint(); | 2159 LayoutAndPaint(); |
2158 } | 2160 } |
2159 | 2161 |
2160 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2162 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
2161 if (UpdateOtherAndManagedButtonsVisibility()) | 2163 if (UpdateOtherAndManagedButtonsVisibility()) |
2162 LayoutAndPaint(); | 2164 LayoutAndPaint(); |
2163 } | 2165 } |
OLD | NEW |