| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 bool Contains(Context context) const { | 104 bool Contains(Context context) const { |
| 105 return (value_ & context) > 0; | 105 return (value_ & context) > 0; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void Add(Context context) { | 108 void Add(Context context) { |
| 109 value_ |= context; | 109 value_ |= context; |
| 110 } | 110 } |
| 111 | 111 |
| 112 scoped_ptr<base::Value> ToValue() const { | 112 scoped_ptr<base::Value> ToValue() const { |
| 113 return scoped_ptr<base::Value>(base::Value::CreateIntegerValue(value_)); | 113 return scoped_ptr<base::Value>(new base::FundamentalValue((int)value_)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool Populate(const base::Value& value) { | 116 bool Populate(const base::Value& value) { |
| 117 int int_value; | 117 int int_value; |
| 118 if (!value.GetAsInteger(&int_value) || int_value < 0) | 118 if (!value.GetAsInteger(&int_value) || int_value < 0) |
| 119 return false; | 119 return false; |
| 120 value_ = int_value; | 120 value_ = int_value; |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 | 123 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 ExtensionIconManager icon_manager_; | 349 ExtensionIconManager icon_manager_; |
| 350 | 350 |
| 351 Profile* profile_; | 351 Profile* profile_; |
| 352 | 352 |
| 353 DISALLOW_COPY_AND_ASSIGN(MenuManager); | 353 DISALLOW_COPY_AND_ASSIGN(MenuManager); |
| 354 }; | 354 }; |
| 355 | 355 |
| 356 } // namespace extensions | 356 } // namespace extensions |
| 357 | 357 |
| 358 #endif // CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ | 358 #endif // CHROME_BROWSER_EXTENSIONS_MENU_MANAGER_H_ |
| OLD | NEW |