| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 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 | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PAGE_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_PAGE_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_PAGE_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_PAGE_MENU_MODEL_H_ |
| 7 | 7 |
| 8 #include "app/menus/simple_menu_model.h" | 8 #include "app/menus/simple_menu_model.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // submenus. | 60 // submenus. |
| 61 class PageMenuModel : public menus::SimpleMenuModel { | 61 class PageMenuModel : public menus::SimpleMenuModel { |
| 62 public: | 62 public: |
| 63 explicit PageMenuModel(menus::SimpleMenuModel::Delegate* delegate, | 63 explicit PageMenuModel(menus::SimpleMenuModel::Delegate* delegate, |
| 64 Browser* browser); | 64 Browser* browser); |
| 65 virtual ~PageMenuModel() { } | 65 virtual ~PageMenuModel() { } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 void Build(); | 68 void Build(); |
| 69 | 69 |
| 70 // The top-level model. | 70 // Models for submenus referenced by this model. SimpleMenuModel only uses |
| 71 scoped_ptr<menus::SimpleMenuModel> model_; | 71 // weak references so these must be kept for the lifetime of the top-level |
| 72 // Models for submenus referenced by model_. SimpleMenuModel only uses weak | 72 // model. |
| 73 // references so these must be kept for the lifetime of the top-level model. | |
| 74 scoped_ptr<ZoomMenuModel> zoom_menu_model_; | 73 scoped_ptr<ZoomMenuModel> zoom_menu_model_; |
| 75 scoped_ptr<EncodingMenuModel> encoding_menu_model_; | 74 scoped_ptr<EncodingMenuModel> encoding_menu_model_; |
| 76 scoped_ptr<DevToolsMenuModel> devtools_menu_model_; | 75 scoped_ptr<DevToolsMenuModel> devtools_menu_model_; |
| 77 Browser* browser_; // weak | 76 Browser* browser_; // weak |
| 78 | 77 |
| 79 DISALLOW_COPY_AND_ASSIGN(PageMenuModel); | 78 DISALLOW_COPY_AND_ASSIGN(PageMenuModel); |
| 80 }; | 79 }; |
| 81 | 80 |
| 82 #endif // CHROME_BROWSER_PAGE_MENU_MODEL_H_ | 81 #endif // CHROME_BROWSER_PAGE_MENU_MODEL_H_ |
| OLD | NEW |