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/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
10 #include "chrome/browser/extensions/extension_util.h" | 10 #include "chrome/browser/extensions/extension_util.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 this)); | 167 this)); |
168 | 168 |
169 resize_animation_.reset(new gfx::SlideAnimation(this)); | 169 resize_animation_.reset(new gfx::SlideAnimation(this)); |
170 resize_area_ = new views::ResizeArea(this); | 170 resize_area_ = new views::ResizeArea(this); |
171 AddChildView(resize_area_); | 171 AddChildView(resize_area_); |
172 | 172 |
173 // 'Main' mode doesn't need a chevron overflow when overflow is shown inside | 173 // 'Main' mode doesn't need a chevron overflow when overflow is shown inside |
174 // the Chrome menu. | 174 // the Chrome menu. |
175 if (!overflow_experiment) { | 175 if (!overflow_experiment) { |
176 chevron_ = new ChevronMenuButton(NULL, base::string16(), this, false); | 176 chevron_ = new ChevronMenuButton(NULL, base::string16(), this, false); |
177 chevron_->SetBorder(views::Border::NullBorder()); | |
178 chevron_->EnableCanvasFlippingForRTLUI(true); | 177 chevron_->EnableCanvasFlippingForRTLUI(true); |
179 chevron_->SetAccessibleName( | 178 chevron_->SetAccessibleName( |
180 l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_CHEVRON)); | 179 l10n_util::GetStringUTF16(IDS_ACCNAME_EXTENSIONS_CHEVRON)); |
181 chevron_->SetVisible(false); | 180 chevron_->SetVisible(false); |
182 AddChildView(chevron_); | 181 AddChildView(chevron_); |
183 } | 182 } |
184 } | 183 } |
185 } | 184 } |
186 | 185 |
187 BrowserActionsContainer::~BrowserActionsContainer() { | 186 BrowserActionsContainer::~BrowserActionsContainer() { |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 size_t absolute_model_size = | 1099 size_t absolute_model_size = |
1101 model_size == -1 ? extensions.size() : model_size; | 1100 model_size == -1 ? extensions.size() : model_size; |
1102 | 1101 |
1103 // The main container will try to show |model_size| icons, but reduce if there | 1102 // The main container will try to show |model_size| icons, but reduce if there |
1104 // aren't enough displayable icons to do so. | 1103 // aren't enough displayable icons to do so. |
1105 size_t main_displayed = std::min(displayable_icon_count, absolute_model_size); | 1104 size_t main_displayed = std::min(displayable_icon_count, absolute_model_size); |
1106 // The overflow will display the extras, if any. | 1105 // The overflow will display the extras, if any. |
1107 return in_overflow_mode() ? | 1106 return in_overflow_mode() ? |
1108 displayable_icon_count - main_displayed : main_displayed; | 1107 displayable_icon_count - main_displayed : main_displayed; |
1109 } | 1108 } |
OLD | NEW |