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

Side by Side Diff: chrome/browser/chromeos/views/menu_locator.h

Issue 6693032: Remove WebUI menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_CHROMEOS_VIEWS_MENU_LOCATOR_H_
6 #define CHROME_BROWSER_CHROMEOS_VIEWS_MENU_LOCATOR_H_
7 #pragma once
8
9 #include "third_party/skia/include/core/SkScalar.h"
10
11 namespace gfx {
12 class Insets;
13 class Point;
14 class Size;
15 } // namespace gfx
16
17 namespace chromeos {
18
19 class WebUIMenuWidget;
20
21 // MenuLocator class contorls where the menu will be placed and
22 // which corners are rounded.
23 // TODO(oshima): support RTL.
24 class MenuLocator {
25 public:
26 enum SubmenuDirection {
27 DEFAULT, // default direction.
28 RIGHT, // submenu should grow to right. (not used now. reserved for RTL)
29 LEFT, // submenu should grow to left.
30 };
31
32 virtual ~MenuLocator() {}
33
34 // Returns the direction that submenu should grow.
35 virtual SubmenuDirection GetSubmenuDirection() const = 0;
36
37 // Move the widget to the right position.
38 virtual void Move(WebUIMenuWidget* widget) = 0;
39
40 // Resize and move the widget to the right position.
41 virtual void SetBounds(WebUIMenuWidget* widget,
42 const gfx::Size& size) = 0;
43
44 // Returns the 8 length array of SkScalar that represents 4 corner
45 // radious for each menu type. The objects are owned by the locator
46 // and should not be deleted. This can be null when SubMenu is
47 // still off screen (not visible).
48 virtual const SkScalar* GetCorners() const = 0;
49
50 // Returns the insets to give space to draw rounded corners.
51 virtual void GetInsets(gfx::Insets* insets) const = 0;
52
53 // Returns the menu locator for dropdown menu. The menu will
54 // positioned so that the top right corner is given by "point".
55 // Only bottom corners are rounded.
56 static MenuLocator* CreateDropDownMenuLocator(const gfx::Point& point);
57
58 // Returns the menu locator for context menu. The menu will
59 // positioned so that the top left corner is given by "point" (in
60 // LTR). All 4 corners are rounded.
61 static MenuLocator* CreateContextMenuLocator(const gfx::Point& point);
62
63 // Returns the menu locator for submenu menu. The menu will
64 // positioned at Y and on the right side of the widget, or on the
65 // left if there is no enough spaceon the right side. Once it changes the
66 // derection, all subsequent submenu should be positioned to the same
67 // direction given by |parent_direction|. 3 corners are
68 // rounded except for the corner that is attached to the widget.
69 static MenuLocator* CreateSubMenuLocator(
70 const WebUIMenuWidget* widget,
71 MenuLocator::SubmenuDirection parent_direction,
72 int y);
73 };
74
75 } // namespace chromeos
76
77 #endif // CHROME_BROWSER_CHROMEOS_VIEWS_MENU_LOCATOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chrome/browser/chromeos/views/menu_locator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698