1 // Copyright (c) 2013 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_BUILDER_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_BUILDER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h"
12 class EncodingMenuModel
;
16 class AcceleratorProvider
;
18 class SimpleMenuModel
;
21 // SystemMenuModelBuilder is responsible for building and owning the system menu
23 class SystemMenuModelBuilder
{
25 SystemMenuModelBuilder(ui::AcceleratorProvider
* provider
, Browser
* browser
);
26 ~SystemMenuModelBuilder();
28 // Populates the menu.
31 // Returns the menu model. SystemMenuModelBuilder owns the returned model.
32 ui::MenuModel
* menu_model() { return menu_model_
.get(); }
35 Browser
* browser() { return menu_delegate_
.browser(); }
37 // Populates |model| with the appropriate contents.
38 void BuildMenu(ui::SimpleMenuModel
* model
);
39 void BuildSystemMenuForBrowserWindow(ui::SimpleMenuModel
* model
);
40 void BuildSystemMenuForAppOrPopupWindow(ui::SimpleMenuModel
* model
);
42 // Adds items for toggling the frame type (if necessary).
43 void AddFrameToggleItems(ui::SimpleMenuModel
* model
);
45 // Add the items to allow the window to visit the desktop of another user.
46 void AppendTeleportMenu(ui::SimpleMenuModel
* model
);
48 SystemMenuModelDelegate menu_delegate_
;
49 scoped_ptr
<ui::MenuModel
> menu_model_
;
50 scoped_ptr
<ZoomMenuModel
> zoom_menu_contents_
;
51 scoped_ptr
<EncodingMenuModel
> encoding_menu_contents_
;
53 DISALLOW_COPY_AND_ASSIGN(SystemMenuModelBuilder
);
56 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_SYSTEM_MENU_MODEL_BUILDER_H_