| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chevron_menu_button.h" | 5 #include "chrome/browser/ui/views/toolbar/chevron_menu_button.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 if (menu_controller_) | 382 if (menu_controller_) |
| 383 menu_controller_->CloseMenu(); | 383 menu_controller_->CloseMenu(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 scoped_ptr<views::LabelButtonBorder> ChevronMenuButton::CreateDefaultBorder() | 386 scoped_ptr<views::LabelButtonBorder> ChevronMenuButton::CreateDefaultBorder() |
| 387 const { | 387 const { |
| 388 // The chevron resource was designed to not have any insets. | 388 // The chevron resource was designed to not have any insets. |
| 389 scoped_ptr<views::LabelButtonBorder> border = | 389 scoped_ptr<views::LabelButtonBorder> border = |
| 390 views::MenuButton::CreateDefaultBorder(); | 390 views::MenuButton::CreateDefaultBorder(); |
| 391 border->set_insets(gfx::Insets()); | 391 border->set_insets(gfx::Insets()); |
| 392 return border.Pass(); | 392 return border; |
| 393 } | 393 } |
| 394 | 394 |
| 395 bool ChevronMenuButton::GetDropFormats( | 395 bool ChevronMenuButton::GetDropFormats( |
| 396 int* formats, | 396 int* formats, |
| 397 std::set<ui::Clipboard::FormatType>* format_types) { | 397 std::set<ui::Clipboard::FormatType>* format_types) { |
| 398 return BrowserActionDragData::GetDropFormats(format_types); | 398 return BrowserActionDragData::GetDropFormats(format_types); |
| 399 } | 399 } |
| 400 | 400 |
| 401 bool ChevronMenuButton::AreDropTypesRequired() { | 401 bool ChevronMenuButton::AreDropTypesRequired() { |
| 402 return BrowserActionDragData::AreDropTypesRequired(); | 402 return BrowserActionDragData::AreDropTypesRequired(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // We should never try to show an overflow menu when one is already visible. | 446 // We should never try to show an overflow menu when one is already visible. |
| 447 DCHECK(!menu_controller_); | 447 DCHECK(!menu_controller_); |
| 448 menu_controller_.reset(new MenuController( | 448 menu_controller_.reset(new MenuController( |
| 449 this, browser_actions_container_, for_drop)); | 449 this, browser_actions_container_, for_drop)); |
| 450 menu_controller_->RunMenu(GetWidget()); | 450 menu_controller_->RunMenu(GetWidget()); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void ChevronMenuButton::MenuDone() { | 453 void ChevronMenuButton::MenuDone() { |
| 454 menu_controller_.reset(); | 454 menu_controller_.reset(); |
| 455 } | 455 } |
| OLD | NEW |