Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: chrome/browser/ui/views/toolbar/chevron_menu_button.h

Issue 1971463002: Get rid of some lingering MD-specific raster assets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msw review Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHEVRON_MENU_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHEVRON_MENU_BUTTON_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ui/views/controls/button/menu_button.h"
13 #include "ui/views/controls/button/menu_button_listener.h"
14
15 class BrowserActionsContainer;
16
17 // The MenuButton for the chevron in the extension toolbar, which is also
18 // responsible for showing the legacy (drop-down) overflow menu.
19 class ChevronMenuButton : public views::MenuButton,
20 public views::MenuButtonListener {
21 public:
22 explicit ChevronMenuButton(
23 BrowserActionsContainer* browser_actions_container);
24 ~ChevronMenuButton() override;
25
26 // Closes the overflow menu (and any context menu), if it is open.
27 void CloseMenu();
28
29 private:
30 class MenuController;
31
32 // views::MenuButton:
33 std::unique_ptr<views::LabelButtonBorder> CreateDefaultBorder()
34 const override;
35 bool GetDropFormats(
36 int* formats,
37 std::set<ui::Clipboard::FormatType>* format_types) override;
38 bool AreDropTypesRequired() override;
39 bool CanDrop(const ui::OSExchangeData& data) override;
40 void OnDragEntered(const ui::DropTargetEvent& event) override;
41 int OnDragUpdated(const ui::DropTargetEvent& event) override;
42 void OnDragExited() override;
43 int OnPerformDrop(const ui::DropTargetEvent& event) override;
44
45 // views::MenuButtonListener:
46 void OnMenuButtonClicked(views::MenuButton* source,
47 const gfx::Point& point,
48 const ui::Event* event) override;
49
50 // Shows the overflow menu.
51 void ShowOverflowMenu(bool for_drop);
52
53 // Called by the overflow menu when all the work is done.
54 void MenuDone();
55
56 // The owning BrowserActionsContainer.
57 BrowserActionsContainer* browser_actions_container_;
58
59 // The overflow menu controller.
60 std::unique_ptr<MenuController> menu_controller_;
61
62 base::WeakPtrFactory<ChevronMenuButton> weak_factory_;
63
64 DISALLOW_COPY_AND_ASSIGN(ChevronMenuButton);
65 };
66
67 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_CHEVRON_MENU_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698