| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_APP_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_APP_MENU_MODEL_H_ |
| 7 |
| 8 #include "app/menus/simple_menu_model.h" |
| 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/user_data_manager.h" |
| 12 |
| 13 class Browser; |
| 14 |
| 15 // A menu model that builds the contents of the app menu. This menu has only |
| 16 // one level (no submenus). |
| 17 class AppMenuModel : public menus::SimpleMenuModel, |
| 18 public GetProfilesHelper::Delegate { |
| 19 public: |
| 20 explicit AppMenuModel(menus::SimpleMenuModel::Delegate* delegate, |
| 21 Browser* browser); |
| 22 virtual ~AppMenuModel(); |
| 23 |
| 24 // Overridden from GetProfilesHelper::Delegate |
| 25 virtual void OnGetProfilesDone( |
| 26 const std::vector<std::wstring>& profiles); |
| 27 |
| 28 private: |
| 29 void Build(); |
| 30 |
| 31 // The top-level model. |
| 32 scoped_ptr<menus::SimpleMenuModel> model_; |
| 33 // Contents of the profiles menu to populate with profile names. |
| 34 scoped_ptr<menus::SimpleMenuModel> profiles_menu_contents_; |
| 35 |
| 36 // Helper class to enumerate profiles information on the file thread. |
| 37 scoped_refptr<GetProfilesHelper> profiles_helper_; |
| 38 |
| 39 Browser* browser_; // weak |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(AppMenuModel); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_APP_MENU_MODEL_H_ |
| OLD | NEW |