| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/extensions/extension_shelf.h" | 5 #include "chrome/browser/views/extensions/extension_shelf.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 698 } |
| 699 | 699 |
| 700 gfx::Size ExtensionShelf::GetPreferredSize() { | 700 gfx::Size ExtensionShelf::GetPreferredSize() { |
| 701 return LayoutItems(true); | 701 return LayoutItems(true); |
| 702 } | 702 } |
| 703 | 703 |
| 704 void ExtensionShelf::ChildPreferredSizeChanged(View* child) { | 704 void ExtensionShelf::ChildPreferredSizeChanged(View* child) { |
| 705 Toolstrip *toolstrip = ToolstripForView(static_cast<ExtensionView*>(child)); | 705 Toolstrip *toolstrip = ToolstripForView(static_cast<ExtensionView*>(child)); |
| 706 if (!toolstrip) | 706 if (!toolstrip) |
| 707 return; | 707 return; |
| 708 Layout(); | 708 |
| 709 PreferredSizeChanged(); |
| 709 } | 710 } |
| 710 | 711 |
| 711 void ExtensionShelf::Layout() { | 712 void ExtensionShelf::Layout() { |
| 712 LayoutItems(false); | 713 LayoutItems(false); |
| 713 } | 714 } |
| 714 | 715 |
| 715 | 716 |
| 716 void ExtensionShelf::OnMouseEntered(const views::MouseEvent& event) { | 717 void ExtensionShelf::OnMouseEntered(const views::MouseEvent& event) { |
| 717 } | 718 } |
| 718 | 719 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 | 1018 |
| 1018 bool ExtensionShelf::IsAlwaysShown() { | 1019 bool ExtensionShelf::IsAlwaysShown() { |
| 1019 Profile* profile = browser_->profile(); | 1020 Profile* profile = browser_->profile(); |
| 1020 return profile->GetPrefs()->GetBoolean(prefs::kShowExtensionShelf); | 1021 return profile->GetPrefs()->GetBoolean(prefs::kShowExtensionShelf); |
| 1021 } | 1022 } |
| 1022 | 1023 |
| 1023 bool ExtensionShelf::OnNewTabPage() { | 1024 bool ExtensionShelf::OnNewTabPage() { |
| 1024 return (browser_ && browser_->GetSelectedTabContents() && | 1025 return (browser_ && browser_->GetSelectedTabContents() && |
| 1025 browser_->GetSelectedTabContents()->IsExtensionShelfAlwaysVisible()); | 1026 browser_->GetSelectedTabContents()->IsExtensionShelfAlwaysVisible()); |
| 1026 } | 1027 } |
| OLD | NEW |