| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 anchor_view = star_view; | 298 anchor_view = star_view; |
| 299 else | 299 else |
| 300 anchor_view = app_menu_button_; | 300 anchor_view = app_menu_button_; |
| 301 } | 301 } |
| 302 | 302 |
| 303 std::unique_ptr<BubbleSyncPromoDelegate> delegate; | 303 std::unique_ptr<BubbleSyncPromoDelegate> delegate; |
| 304 delegate.reset(new BookmarkBubbleSignInDelegate(browser_)); | 304 delegate.reset(new BookmarkBubbleSignInDelegate(browser_)); |
| 305 views::Widget* bubble_widget = BookmarkBubbleView::ShowBubble( | 305 views::Widget* bubble_widget = BookmarkBubbleView::ShowBubble( |
| 306 anchor_view, gfx::Rect(), nullptr, observer, std::move(delegate), | 306 anchor_view, gfx::Rect(), nullptr, observer, std::move(delegate), |
| 307 browser_->profile(), url, already_bookmarked); | 307 browser_->profile(), url, already_bookmarked); |
| 308 if (star_view) | 308 if (bubble_widget && star_view) |
| 309 bubble_widget->AddObserver(star_view); | 309 bubble_widget->AddObserver(star_view); |
| 310 } | 310 } |
| 311 | 311 |
| 312 views::View* ToolbarView::GetSaveCreditCardBubbleAnchor() { | 312 views::View* ToolbarView::GetSaveCreditCardBubbleAnchor() { |
| 313 views::View* save_credit_card_icon_view = | 313 views::View* save_credit_card_icon_view = |
| 314 location_bar()->save_credit_card_icon_view(); | 314 location_bar()->save_credit_card_icon_view(); |
| 315 return (save_credit_card_icon_view && save_credit_card_icon_view->visible()) | 315 return (save_credit_card_icon_view && save_credit_card_icon_view->visible()) |
| 316 ? save_credit_card_icon_view | 316 ? save_credit_card_icon_view |
| 317 : app_menu_button_; | 317 : app_menu_button_; |
| 318 } | 318 } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 if (OutdatedUpgradeBubbleView::IsAvailable()) { | 757 if (OutdatedUpgradeBubbleView::IsAvailable()) { |
| 758 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, | 758 OutdatedUpgradeBubbleView::ShowBubble(app_menu_button_, browser_, |
| 759 auto_update_enabled); | 759 auto_update_enabled); |
| 760 } | 760 } |
| 761 } | 761 } |
| 762 | 762 |
| 763 void ToolbarView::OnShowHomeButtonChanged() { | 763 void ToolbarView::OnShowHomeButtonChanged() { |
| 764 Layout(); | 764 Layout(); |
| 765 SchedulePaint(); | 765 SchedulePaint(); |
| 766 } | 766 } |
| OLD | NEW |