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

Side by Side Diff: components/undo/bookmark_undo_service.cc

Issue 1549993003: Switch to standard integer types in components/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
« no previous file with comments | « components/undo/bookmark_undo_service.h ('k') | components/undo/bookmark_undo_service_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/undo/bookmark_undo_service.h" 5 #include "components/undo/bookmark_undo_service.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
10 #include "base/macros.h"
7 #include "components/bookmarks/browser/bookmark_model.h" 11 #include "components/bookmarks/browser/bookmark_model.h"
8 #include "components/bookmarks/browser/bookmark_node_data.h" 12 #include "components/bookmarks/browser/bookmark_node_data.h"
9 #include "components/bookmarks/browser/bookmark_undo_provider.h" 13 #include "components/bookmarks/browser/bookmark_undo_provider.h"
10 #include "components/bookmarks/browser/bookmark_utils.h" 14 #include "components/bookmarks/browser/bookmark_utils.h"
11 #include "components/bookmarks/browser/scoped_group_bookmark_actions.h" 15 #include "components/bookmarks/browser/scoped_group_bookmark_actions.h"
12 #include "components/undo/undo_operation.h" 16 #include "components/undo/undo_operation.h"
13 #include "grit/components_strings.h" 17 #include "grit/components_strings.h"
14 18
15 using bookmarks::BookmarkModel; 19 using bookmarks::BookmarkModel;
16 using bookmarks::BookmarkNode; 20 using bookmarks::BookmarkNode;
(...skipping 27 matching lines...) Expand all
44 const BookmarkNode* parent, 48 const BookmarkNode* parent,
45 int index); 49 int index);
46 ~BookmarkAddOperation() override {} 50 ~BookmarkAddOperation() override {}
47 51
48 // UndoOperation: 52 // UndoOperation:
49 void Undo() override; 53 void Undo() override;
50 int GetUndoLabelId() const override; 54 int GetUndoLabelId() const override;
51 int GetRedoLabelId() const override; 55 int GetRedoLabelId() const override;
52 56
53 private: 57 private:
54 int64 parent_id_; 58 int64_t parent_id_;
55 const int index_; 59 const int index_;
56 60
57 DISALLOW_COPY_AND_ASSIGN(BookmarkAddOperation); 61 DISALLOW_COPY_AND_ASSIGN(BookmarkAddOperation);
58 }; 62 };
59 63
60 BookmarkAddOperation::BookmarkAddOperation( 64 BookmarkAddOperation::BookmarkAddOperation(
61 BookmarkModel* bookmark_model, 65 BookmarkModel* bookmark_model,
62 const BookmarkNode* parent, 66 const BookmarkNode* parent,
63 int index) 67 int index)
64 : BookmarkUndoOperation(bookmark_model), 68 : BookmarkUndoOperation(bookmark_model),
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 BookmarkEditOperation(BookmarkModel* bookmark_model, 158 BookmarkEditOperation(BookmarkModel* bookmark_model,
155 const BookmarkNode* node); 159 const BookmarkNode* node);
156 ~BookmarkEditOperation() override {} 160 ~BookmarkEditOperation() override {}
157 161
158 // UndoOperation: 162 // UndoOperation:
159 void Undo() override; 163 void Undo() override;
160 int GetUndoLabelId() const override; 164 int GetUndoLabelId() const override;
161 int GetRedoLabelId() const override; 165 int GetRedoLabelId() const override;
162 166
163 private: 167 private:
164 int64 node_id_; 168 int64_t node_id_;
165 BookmarkNodeData original_bookmark_; 169 BookmarkNodeData original_bookmark_;
166 170
167 DISALLOW_COPY_AND_ASSIGN(BookmarkEditOperation); 171 DISALLOW_COPY_AND_ASSIGN(BookmarkEditOperation);
168 }; 172 };
169 173
170 BookmarkEditOperation::BookmarkEditOperation( 174 BookmarkEditOperation::BookmarkEditOperation(
171 BookmarkModel* bookmark_model, 175 BookmarkModel* bookmark_model,
172 const BookmarkNode* node) 176 const BookmarkNode* node)
173 : BookmarkUndoOperation(bookmark_model), 177 : BookmarkUndoOperation(bookmark_model),
174 node_id_(node->id()), 178 node_id_(node->id()),
(...skipping 30 matching lines...) Expand all
205 const BookmarkNode* new_parent, 209 const BookmarkNode* new_parent,
206 int new_index); 210 int new_index);
207 ~BookmarkMoveOperation() override {} 211 ~BookmarkMoveOperation() override {}
208 int GetUndoLabelId() const override; 212 int GetUndoLabelId() const override;
209 int GetRedoLabelId() const override; 213 int GetRedoLabelId() const override;
210 214
211 // UndoOperation: 215 // UndoOperation:
212 void Undo() override; 216 void Undo() override;
213 217
214 private: 218 private:
215 int64 old_parent_id_; 219 int64_t old_parent_id_;
216 int64 new_parent_id_; 220 int64_t new_parent_id_;
217 int old_index_; 221 int old_index_;
218 int new_index_; 222 int new_index_;
219 223
220 DISALLOW_COPY_AND_ASSIGN(BookmarkMoveOperation); 224 DISALLOW_COPY_AND_ASSIGN(BookmarkMoveOperation);
221 }; 225 };
222 226
223 BookmarkMoveOperation::BookmarkMoveOperation( 227 BookmarkMoveOperation::BookmarkMoveOperation(
224 BookmarkModel* bookmark_model, 228 BookmarkModel* bookmark_model,
225 const BookmarkNode* old_parent, 229 const BookmarkNode* old_parent,
226 int old_index, 230 int old_index,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 BookmarkReorderOperation(BookmarkModel* bookmark_model, 277 BookmarkReorderOperation(BookmarkModel* bookmark_model,
274 const BookmarkNode* parent); 278 const BookmarkNode* parent);
275 ~BookmarkReorderOperation() override; 279 ~BookmarkReorderOperation() override;
276 280
277 // UndoOperation: 281 // UndoOperation:
278 void Undo() override; 282 void Undo() override;
279 int GetUndoLabelId() const override; 283 int GetUndoLabelId() const override;
280 int GetRedoLabelId() const override; 284 int GetRedoLabelId() const override;
281 285
282 private: 286 private:
283 int64 parent_id_; 287 int64_t parent_id_;
284 std::vector<int64> ordered_bookmarks_; 288 std::vector<int64_t> ordered_bookmarks_;
285 289
286 DISALLOW_COPY_AND_ASSIGN(BookmarkReorderOperation); 290 DISALLOW_COPY_AND_ASSIGN(BookmarkReorderOperation);
287 }; 291 };
288 292
289 BookmarkReorderOperation::BookmarkReorderOperation( 293 BookmarkReorderOperation::BookmarkReorderOperation(
290 BookmarkModel* bookmark_model, 294 BookmarkModel* bookmark_model,
291 const BookmarkNode* parent) 295 const BookmarkNode* parent)
292 : BookmarkUndoOperation(bookmark_model), 296 : BookmarkUndoOperation(bookmark_model),
293 parent_id_(parent->id()) { 297 parent_id_(parent->id()) {
294 ordered_bookmarks_.resize(parent->child_count()); 298 ordered_bookmarks_.resize(parent->child_count());
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 404
401 void BookmarkUndoService::OnBookmarkNodeRemoved(BookmarkModel* model, 405 void BookmarkUndoService::OnBookmarkNodeRemoved(BookmarkModel* model,
402 const BookmarkNode* parent, 406 const BookmarkNode* parent,
403 int index, 407 int index,
404 scoped_ptr<BookmarkNode> node) { 408 scoped_ptr<BookmarkNode> node) {
405 DCHECK(undo_provider_); 409 DCHECK(undo_provider_);
406 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation( 410 scoped_ptr<UndoOperation> op(new BookmarkRemoveOperation(
407 model, undo_provider_, parent, index, node.Pass())); 411 model, undo_provider_, parent, index, node.Pass()));
408 undo_manager()->AddUndoOperation(op.Pass()); 412 undo_manager()->AddUndoOperation(op.Pass());
409 } 413 }
OLDNEW
« no previous file with comments | « components/undo/bookmark_undo_service.h ('k') | components/undo/bookmark_undo_service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698