Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: chrome/browser/extensions/app_notification.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/webrequest/webrequest_api.cc ('k') | chrome/browser/extensions/app_notification_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698