Chromium Code Reviews| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 } | 235 } |
| 236 | 236 |
| 237 scoped_ptr<views::InkDropHover> CreateInkDropHover() const override { | 237 scoped_ptr<views::InkDropHover> CreateInkDropHover() const override { |
| 238 if (!ShouldShowInkDropHover()) | 238 if (!ShouldShowInkDropHover()) |
| 239 return nullptr; | 239 return nullptr; |
| 240 return make_scoped_ptr(new views::InkDropHover( | 240 return make_scoped_ptr(new views::InkDropHover( |
| 241 size(), 0, GetInkDropCenter(), GetInkDropBaseColor())); | 241 size(), 0, GetInkDropCenter(), GetInkDropBaseColor())); |
| 242 } | 242 } |
| 243 | 243 |
| 244 SkColor GetInkDropBaseColor() const override { | 244 SkColor GetInkDropBaseColor() const override { |
| 245 // TODO(bruthig): Inject the color instead of assuming a ThemeProvider is | 245 DCHECK(GetThemeProvider()); |
|
Evan Stade
2016/03/17 21:41:35
the style guide says not to dcheck right before de
bruthig
2016/03/18 00:22:41
Yeah, I know that the style guide says to avoid th
Evan Stade
2016/03/18 01:20:22
add a debug line: base::debug::StackTrace().Print(
bruthig
2016/03/18 15:39:21
Removed.
| |
| 246 // always available. Fall back on LabelButton::GetInkDropBaseColor() so as | 246 return GetThemeProvider()->GetColor( |
| 247 // to avoid difficult to track down crashes. | 247 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
| 248 return GetThemeProvider() | |
| 249 ? GetThemeProvider()->GetColor( | |
| 250 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON) | |
| 251 : views::LabelButton::GetInkDropBaseColor(); | |
| 252 } | 248 } |
| 253 | 249 |
| 254 private: | 250 private: |
| 255 scoped_ptr<gfx::SlideAnimation> show_animation_; | 251 scoped_ptr<gfx::SlideAnimation> show_animation_; |
| 256 | 252 |
| 257 // Controls the visual feedback for the button state. | 253 // Controls the visual feedback for the button state. |
| 258 views::ButtonInkDropDelegate ink_drop_delegate_; | 254 views::ButtonInkDropDelegate ink_drop_delegate_; |
| 259 | 255 |
| 260 DISALLOW_COPY_AND_ASSIGN(BookmarkButtonBase); | 256 DISALLOW_COPY_AND_ASSIGN(BookmarkButtonBase); |
| 261 }; | 257 }; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 } | 334 } |
| 339 | 335 |
| 340 scoped_ptr<views::InkDropHover> CreateInkDropHover() const override { | 336 scoped_ptr<views::InkDropHover> CreateInkDropHover() const override { |
| 341 if (!ShouldShowInkDropHover()) | 337 if (!ShouldShowInkDropHover()) |
| 342 return nullptr; | 338 return nullptr; |
| 343 return make_scoped_ptr(new views::InkDropHover( | 339 return make_scoped_ptr(new views::InkDropHover( |
| 344 size(), 0, GetInkDropCenter(), GetInkDropBaseColor())); | 340 size(), 0, GetInkDropCenter(), GetInkDropBaseColor())); |
| 345 } | 341 } |
| 346 | 342 |
| 347 SkColor GetInkDropBaseColor() const override { | 343 SkColor GetInkDropBaseColor() const override { |
| 348 return GetThemeProvider() | 344 DCHECK(GetThemeProvider()); |
| 349 ? GetThemeProvider()->GetColor( | 345 return GetThemeProvider()->GetColor( |
| 350 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON) | 346 ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); |
| 351 : views::LabelButton::GetInkDropBaseColor(); | |
| 352 } | 347 } |
| 353 | 348 |
| 354 private: | 349 private: |
| 355 // Controls the visual feedback for the button state. | 350 // Controls the visual feedback for the button state. |
| 356 views::ButtonInkDropDelegate ink_drop_delegate_; | 351 views::ButtonInkDropDelegate ink_drop_delegate_; |
| 357 | 352 |
| 358 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuButtonBase); | 353 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuButtonBase); |
| 359 }; | 354 }; |
| 360 | 355 |
| 361 // BookmarkFolderButton ------------------------------------------------------- | 356 // BookmarkFolderButton ------------------------------------------------------- |
| (...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2150 return; | 2145 return; |
| 2151 apps_page_shortcut_->SetVisible(visible); | 2146 apps_page_shortcut_->SetVisible(visible); |
| 2152 UpdateBookmarksSeparatorVisibility(); | 2147 UpdateBookmarksSeparatorVisibility(); |
| 2153 LayoutAndPaint(); | 2148 LayoutAndPaint(); |
| 2154 } | 2149 } |
| 2155 | 2150 |
| 2156 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { | 2151 void BookmarkBarView::OnShowManagedBookmarksPrefChanged() { |
| 2157 if (UpdateOtherAndManagedButtonsVisibility()) | 2152 if (UpdateOtherAndManagedButtonsVisibility()) |
| 2158 LayoutAndPaint(); | 2153 LayoutAndPaint(); |
| 2159 } | 2154 } |
| OLD | NEW |