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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 // ToolbarView, ui::AcceleratorProvider implementation: | 531 // ToolbarView, ui::AcceleratorProvider implementation: |
532 | 532 |
533 bool ToolbarView::GetAcceleratorForCommandId(int command_id, | 533 bool ToolbarView::GetAcceleratorForCommandId(int command_id, |
534 ui::Accelerator* accelerator) { | 534 ui::Accelerator* accelerator) { |
535 return GetWidget()->GetAccelerator(command_id, accelerator); | 535 return GetWidget()->GetAccelerator(command_id, accelerator); |
536 } | 536 } |
537 | 537 |
538 //////////////////////////////////////////////////////////////////////////////// | 538 //////////////////////////////////////////////////////////////////////////////// |
539 // ToolbarView, views::View overrides: | 539 // ToolbarView, views::View overrides: |
540 | 540 |
541 gfx::Size ToolbarView::GetPreferredSize() { | 541 gfx::Size ToolbarView::GetPreferredSize() const { |
542 gfx::Size size(location_bar_->GetPreferredSize()); | 542 gfx::Size size(location_bar_->GetPreferredSize()); |
543 if (is_display_mode_normal()) { | 543 if (is_display_mode_normal()) { |
544 size.Enlarge( | 544 size.Enlarge( |
545 kLeftEdgeSpacing + back_->GetPreferredSize().width() + | 545 kLeftEdgeSpacing + back_->GetPreferredSize().width() + |
546 forward_->GetPreferredSize().width() + | 546 forward_->GetPreferredSize().width() + |
547 reload_->GetPreferredSize().width() + kStandardSpacing + | 547 reload_->GetPreferredSize().width() + kStandardSpacing + |
548 (show_home_button_.GetValue() ? | 548 (show_home_button_.GetValue() ? |
549 home_->GetPreferredSize().width() : 0) + | 549 home_->GetPreferredSize().width() : 0) + |
550 (origin_chip_view_->visible() ? | 550 (origin_chip_view_->visible() ? |
551 (origin_chip_view_->GetPreferredSize().width() + | 551 (origin_chip_view_->GetPreferredSize().width() + |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 877 |
878 void ToolbarView::OnShowHomeButtonChanged() { | 878 void ToolbarView::OnShowHomeButtonChanged() { |
879 Layout(); | 879 Layout(); |
880 SchedulePaint(); | 880 SchedulePaint(); |
881 } | 881 } |
882 | 882 |
883 int ToolbarView::content_shadow_height() const { | 883 int ToolbarView::content_shadow_height() const { |
884 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? | 884 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? |
885 kContentShadowHeightAsh : kContentShadowHeight; | 885 kContentShadowHeightAsh : kContentShadowHeight; |
886 } | 886 } |
OLD | NEW |