| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 void ToolbarView::SetPaneFocusAndFocusAppMenu() { | 304 void ToolbarView::SetPaneFocusAndFocusAppMenu() { |
| 305 SetPaneFocus(app_menu_button_); | 305 SetPaneFocus(app_menu_button_); |
| 306 } | 306 } |
| 307 | 307 |
| 308 bool ToolbarView::IsAppMenuFocused() { | 308 bool ToolbarView::IsAppMenuFocused() { |
| 309 return app_menu_button_->HasFocus(); | 309 return app_menu_button_->HasFocus(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 views::View* ToolbarView::GetBookmarkBubbleAnchor() { | 312 views::WidgetObserverView* ToolbarView::GetBookmarkBubbleAnchor() { |
| 313 views::View* star_view = location_bar()->star_view(); | 313 views::WidgetObserverView* star_view = location_bar()->star_view(); |
| 314 return (star_view && star_view->visible()) ? star_view : app_menu_button_; | 314 return (star_view && star_view->visible()) ? star_view : app_menu_button_; |
| 315 } | 315 } |
| 316 | 316 |
| 317 views::View* ToolbarView::GetSaveCreditCardBubbleAnchor() { | 317 views::WidgetObserverView* ToolbarView::GetSaveCreditCardBubbleAnchor() { |
| 318 views::View* save_credit_card_icon_view = | 318 views::WidgetObserverView* save_credit_card_icon_view = |
| 319 location_bar()->save_credit_card_icon_view(); | 319 location_bar()->save_credit_card_icon_view(); |
| 320 return (save_credit_card_icon_view && save_credit_card_icon_view->visible()) | 320 return (save_credit_card_icon_view && save_credit_card_icon_view->visible()) |
| 321 ? save_credit_card_icon_view | 321 ? save_credit_card_icon_view |
| 322 : app_menu_button_; | 322 : app_menu_button_; |
| 323 } | 323 } |
| 324 | 324 |
| 325 views::View* ToolbarView::GetTranslateBubbleAnchor() { | 325 views::WidgetObserverView* ToolbarView::GetTranslateBubbleAnchor() { |
| 326 views::View* translate_icon_view = location_bar()->translate_icon_view(); | 326 views::WidgetObserverView* translate_icon_view = |
| 327 location_bar()->translate_icon_view(); |
| 327 return (translate_icon_view && translate_icon_view->visible()) | 328 return (translate_icon_view && translate_icon_view->visible()) |
| 328 ? translate_icon_view | 329 ? translate_icon_view |
| 329 : app_menu_button_; | 330 : app_menu_button_; |
| 330 } | 331 } |
| 331 | 332 |
| 332 void ToolbarView::ExecuteExtensionCommand( | 333 void ToolbarView::ExecuteExtensionCommand( |
| 333 const extensions::Extension* extension, | 334 const extensions::Extension* extension, |
| 334 const extensions::Command& command) { | 335 const extensions::Command& command) { |
| 335 browser_actions_->ExecuteExtensionCommand(extension, command); | 336 browser_actions_->ExecuteExtensionCommand(extension, command); |
| 336 } | 337 } |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 void ToolbarView::OnShowHomeButtonChanged() { | 812 void ToolbarView::OnShowHomeButtonChanged() { |
| 812 Layout(); | 813 Layout(); |
| 813 SchedulePaint(); | 814 SchedulePaint(); |
| 814 } | 815 } |
| 815 | 816 |
| 816 int ToolbarView::content_shadow_height() const { | 817 int ToolbarView::content_shadow_height() const { |
| 817 return GetLayoutConstant( | 818 return GetLayoutConstant( |
| 818 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? | 819 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? |
| 819 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); | 820 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); |
| 820 } | 821 } |
| OLD | NEW |