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

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

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 const std::string& title, 114 const std::string& title,
115 bool checked, 115 bool checked,
116 bool enabled, 116 bool enabled,
117 Type type, 117 Type type,
118 const ContextList& contexts) 118 const ContextList& contexts)
119 : id_(id), 119 : id_(id),
120 title_(title), 120 title_(title),
121 type_(type), 121 type_(type),
122 checked_(checked), 122 checked_(checked),
123 enabled_(enabled), 123 enabled_(enabled),
124 contexts_(contexts), 124 contexts_(contexts) {}
125 parent_id_(0) {
126 }
127 125
128 MenuItem::~MenuItem() { 126 MenuItem::~MenuItem() {
129 STLDeleteElements(&children_); 127 STLDeleteElements(&children_);
130 } 128 }
131 129
132 MenuItem* MenuItem::ReleaseChild(const Id& child_id, 130 MenuItem* MenuItem::ReleaseChild(const Id& child_id,
133 bool recursive) { 131 bool recursive) {
134 for (List::iterator i = children_.begin(); i != children_.end(); ++i) { 132 for (List::iterator i = children_.begin(); i != children_.end(); ++i) {
135 MenuItem* child = NULL; 133 MenuItem* child = NULL;
136 if ((*i)->id() == child_id) { 134 if ((*i)->id() == child_id) {
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 if (uid < other.uid) 860 if (uid < other.uid)
863 return true; 861 return true;
864 if (uid == other.uid) 862 if (uid == other.uid)
865 return string_uid < other.string_uid; 863 return string_uid < other.string_uid;
866 } 864 }
867 } 865 }
868 return false; 866 return false;
869 } 867 }
870 868
871 } // namespace extensions 869 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698