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/app_notification.h" | 5 #include "chrome/browser/extensions/app_notification.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/common/guid.h" | 10 #include "chrome/common/guid.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 title_ == other.title_ && | 130 title_ == other.title_ && |
131 body_ == other.body_ && | 131 body_ == other.body_ && |
132 link_url_ == other.link_url_ && | 132 link_url_ == other.link_url_ && |
133 link_text_ == other.link_text_); | 133 link_text_ == other.link_text_); |
134 } | 134 } |
135 | 135 |
136 std::string AppNotification::ToString() const { | 136 std::string AppNotification::ToString() const { |
137 DictionaryValue value; | 137 DictionaryValue value; |
138 ToDictionaryValue(&value); | 138 ToDictionaryValue(&value); |
139 std::string result; | 139 std::string result; |
140 base::JSONWriter::Write(&value, true, &result); | 140 base::JSONWriter::WriteWithOptions(&value, |
| 141 base::JSONWriter::OPTIONS_PRETTY_PRINT, |
| 142 &result); |
141 return result; | 143 return result; |
142 } | 144 } |
143 | 145 |
144 AppNotificationList* CopyAppNotificationList( | 146 AppNotificationList* CopyAppNotificationList( |
145 const AppNotificationList& source) { | 147 const AppNotificationList& source) { |
146 AppNotificationList* copy = new AppNotificationList(); | 148 AppNotificationList* copy = new AppNotificationList(); |
147 | 149 |
148 for (AppNotificationList::const_iterator iter = source.begin(); | 150 for (AppNotificationList::const_iterator iter = source.begin(); |
149 iter != source.end(); ++iter) { | 151 iter != source.end(); ++iter) { |
150 copy->push_back(linked_ptr<AppNotification>(iter->get()->Copy())); | 152 copy->push_back(linked_ptr<AppNotification>(iter->get()->Copy())); |
151 } | 153 } |
152 return copy; | 154 return copy; |
153 } | 155 } |
OLD | NEW |