Chromium Code Reviews| 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 : app_menu_button_; | 322 : app_menu_button_; |
| 323 } | 323 } |
| 324 | 324 |
| 325 views::View* ToolbarView::GetTranslateBubbleAnchor() { | 325 views::View* ToolbarView::GetTranslateBubbleAnchor() { |
| 326 views::View* translate_icon_view = location_bar()->translate_icon_view(); | 326 views::View* translate_icon_view = location_bar()->translate_icon_view(); |
| 327 return (translate_icon_view && translate_icon_view->visible()) | 327 return (translate_icon_view && translate_icon_view->visible()) |
| 328 ? translate_icon_view | 328 ? translate_icon_view |
| 329 : app_menu_button_; | 329 : app_menu_button_; |
| 330 } | 330 } |
| 331 | 331 |
| 332 void ToolbarView::OnBubbleCreatedForAnchor(views::View* anchor_view, | |
| 333 views::Widget* bubble_widget) { | |
| 334 if (bubble_widget && | |
| 335 (anchor_view == location_bar()->star_view() || | |
| 336 anchor_view == location_bar()->save_credit_card_icon_view() || | |
| 337 anchor_view == location_bar()->translate_icon_view())) { | |
| 338 DCHECK(anchor_view); | |
| 339 bubble_widget->AddObserver(static_cast<BubbleIconView*>(anchor_view)); | |
|
msw
2016/01/28 23:27:42
q: Did you want the app list view to actually show
varkha
2016/01/29 00:00:40
Do you mean |app_menu_button_|? If so then no, we
msw
2016/01/29 00:02:01
Sorry, yeah that's what I meant; acknowledged.
| |
| 340 } | |
| 341 } | |
| 342 | |
| 332 void ToolbarView::ExecuteExtensionCommand( | 343 void ToolbarView::ExecuteExtensionCommand( |
| 333 const extensions::Extension* extension, | 344 const extensions::Extension* extension, |
| 334 const extensions::Command& command) { | 345 const extensions::Command& command) { |
| 335 browser_actions_->ExecuteExtensionCommand(extension, command); | 346 browser_actions_->ExecuteExtensionCommand(extension, command); |
| 336 } | 347 } |
| 337 | 348 |
| 338 int ToolbarView::GetMaxBrowserActionsWidth() const { | 349 int ToolbarView::GetMaxBrowserActionsWidth() const { |
| 339 // The browser actions container is allowed to grow, but only up until the | 350 // The browser actions container is allowed to grow, but only up until the |
| 340 // omnibox reaches its minimum size. So its maximum allowed width is its | 351 // omnibox reaches its minimum size. So its maximum allowed width is its |
| 341 // current size, plus any that the omnibox could give up. | 352 // current size, plus any that the omnibox could give up. |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 void ToolbarView::OnShowHomeButtonChanged() { | 822 void ToolbarView::OnShowHomeButtonChanged() { |
| 812 Layout(); | 823 Layout(); |
| 813 SchedulePaint(); | 824 SchedulePaint(); |
| 814 } | 825 } |
| 815 | 826 |
| 816 int ToolbarView::content_shadow_height() const { | 827 int ToolbarView::content_shadow_height() const { |
| 817 return GetLayoutConstant( | 828 return GetLayoutConstant( |
| 818 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? | 829 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? |
| 819 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); | 830 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); |
| 820 } | 831 } |
| OLD | NEW |