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_action_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 LabelButton::OnGestureEvent(event); | 222 LabelButton::OnGestureEvent(event); |
223 } | 223 } |
224 | 224 |
225 scoped_ptr<LabelButtonBorder> ToolbarActionView::CreateDefaultBorder() const { | 225 scoped_ptr<LabelButtonBorder> ToolbarActionView::CreateDefaultBorder() const { |
226 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder(); | 226 scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder(); |
227 border->set_insets(gfx::Insets(kBorderInset, kBorderInset, | 227 border->set_insets(gfx::Insets(kBorderInset, kBorderInset, |
228 kBorderInset, kBorderInset)); | 228 kBorderInset, kBorderInset)); |
229 return border.Pass(); | 229 return border.Pass(); |
230 } | 230 } |
231 | 231 |
232 bool ToolbarActionView::ShouldEnterPushedState(const ui::Event& event) { | |
233 return view_controller_->HasPopup(GetCurrentWebContents()) ? | |
234 MenuButton::ShouldEnterPushedState(event) : | |
235 LabelButton::ShouldEnterPushedState(event); | |
Finnur
2015/02/20 10:36:10
style-nit: Maybe I'm getting tainted by writing mo
Devlin
2015/02/20 22:56:20
According to the conclusion in https://groups.goog
| |
236 } | |
237 | |
232 gfx::ImageSkia ToolbarActionView::GetIconForTest() { | 238 gfx::ImageSkia ToolbarActionView::GetIconForTest() { |
233 return GetImage(views::Button::STATE_NORMAL); | 239 return GetImage(views::Button::STATE_NORMAL); |
234 } | 240 } |
235 | 241 |
236 views::View* ToolbarActionView::GetAsView() { | 242 views::View* ToolbarActionView::GetAsView() { |
237 return this; | 243 return this; |
238 } | 244 } |
239 | 245 |
240 bool ToolbarActionView::IsShownInMenu() { | 246 bool ToolbarActionView::IsShownInMenu() { |
241 return delegate_->ShownInsideMenu(); | 247 return delegate_->ShownInsideMenu(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 views::MenuButton* reference_view = | 293 views::MenuButton* reference_view = |
288 static_cast<views::MenuButton*>(GetReferenceViewForPopup()); | 294 static_cast<views::MenuButton*>(GetReferenceViewForPopup()); |
289 pressed_lock_.reset(new views::MenuButton::PressedLock(reference_view)); | 295 pressed_lock_.reset(new views::MenuButton::PressedLock(reference_view)); |
290 } | 296 } |
291 } | 297 } |
292 | 298 |
293 void ToolbarActionView::OnPopupClosed() { | 299 void ToolbarActionView::OnPopupClosed() { |
294 delegate_->SetPopupOwner(nullptr); | 300 delegate_->SetPopupOwner(nullptr); |
295 pressed_lock_.reset(); // Unpress the menu button if it was pressed. | 301 pressed_lock_.reset(); // Unpress the menu button if it was pressed. |
296 } | 302 } |
OLD | NEW |