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 #include "chrome/browser/extensions/menu_manager.h" | 5 #include "chrome/browser/extensions/menu_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 DCHECK_EQ(0, id_.uid); | 195 DCHECK_EQ(0, id_.uid); |
196 value->SetString(kStringUIDKey, id_.string_uid); | 196 value->SetString(kStringUIDKey, id_.string_uid); |
197 value->SetBoolean(kIncognitoKey, id_.incognito); | 197 value->SetBoolean(kIncognitoKey, id_.incognito); |
198 value->SetInteger(kTypeKey, type_); | 198 value->SetInteger(kTypeKey, type_); |
199 if (type_ != SEPARATOR) | 199 if (type_ != SEPARATOR) |
200 value->SetString(kTitleKey, title_); | 200 value->SetString(kTitleKey, title_); |
201 if (type_ == CHECKBOX || type_ == RADIO) | 201 if (type_ == CHECKBOX || type_ == RADIO) |
202 value->SetBoolean(kCheckedKey, checked_); | 202 value->SetBoolean(kCheckedKey, checked_); |
203 value->SetBoolean(kEnabledKey, enabled_); | 203 value->SetBoolean(kEnabledKey, enabled_); |
204 value->Set(kContextsKey, contexts_.ToValue().release()); | 204 value->Set(kContextsKey, contexts_.ToValue().release()); |
205 if (parent_id_.get()) { | 205 if (parent_id_) { |
206 DCHECK_EQ(0, parent_id_->uid); | 206 DCHECK_EQ(0, parent_id_->uid); |
207 value->SetString(kParentUIDKey, parent_id_->string_uid); | 207 value->SetString(kParentUIDKey, parent_id_->string_uid); |
208 } | 208 } |
209 value->Set(kDocumentURLPatternsKey, | 209 value->Set(kDocumentURLPatternsKey, |
210 document_url_patterns_.ToValue().release()); | 210 document_url_patterns_.ToValue().release()); |
211 value->Set(kTargetURLPatternsKey, target_url_patterns_.ToValue().release()); | 211 value->Set(kTargetURLPatternsKey, target_url_patterns_.ToValue().release()); |
212 return value.Pass(); | 212 return value.Pass(); |
213 } | 213 } |
214 | 214 |
215 // static | 215 // static |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 if (uid < other.uid) | 862 if (uid < other.uid) |
863 return true; | 863 return true; |
864 if (uid == other.uid) | 864 if (uid == other.uid) |
865 return string_uid < other.string_uid; | 865 return string_uid < other.string_uid; |
866 } | 866 } |
867 } | 867 } |
868 return false; | 868 return false; |
869 } | 869 } |
870 | 870 |
871 } // namespace extensions | 871 } // namespace extensions |
OLD | NEW |