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())) { | |
|
Peter Kasting
2016/01/28 20:42:12
Nit: {} not necessary
varkha
2016/01/28 22:04:52
I am used to the style guide allowing this[1] for
Peter Kasting
2016/01/28 22:21:22
Right, it's allowed if you want it. Probably more
| |
| 338 bubble_widget->AddObserver(static_cast<BubbleIconView*>(anchor_view)); | |
| 339 } | |
| 340 } | |
| 341 | |
| 332 void ToolbarView::ExecuteExtensionCommand( | 342 void ToolbarView::ExecuteExtensionCommand( |
| 333 const extensions::Extension* extension, | 343 const extensions::Extension* extension, |
| 334 const extensions::Command& command) { | 344 const extensions::Command& command) { |
| 335 browser_actions_->ExecuteExtensionCommand(extension, command); | 345 browser_actions_->ExecuteExtensionCommand(extension, command); |
| 336 } | 346 } |
| 337 | 347 |
| 338 int ToolbarView::GetMaxBrowserActionsWidth() const { | 348 int ToolbarView::GetMaxBrowserActionsWidth() const { |
| 339 // The browser actions container is allowed to grow, but only up until the | 349 // 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 | 350 // omnibox reaches its minimum size. So its maximum allowed width is its |
| 341 // current size, plus any that the omnibox could give up. | 351 // 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() { | 821 void ToolbarView::OnShowHomeButtonChanged() { |
| 812 Layout(); | 822 Layout(); |
| 813 SchedulePaint(); | 823 SchedulePaint(); |
| 814 } | 824 } |
| 815 | 825 |
| 816 int ToolbarView::content_shadow_height() const { | 826 int ToolbarView::content_shadow_height() const { |
| 817 return GetLayoutConstant( | 827 return GetLayoutConstant( |
| 818 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? | 828 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? |
| 819 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); | 829 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); |
| 820 } | 830 } |
| OLD | NEW |