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

Side by Side Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc

Issue 1101833002: Updating modification time of parent when a folder node is added in it in bookmark bar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/api/bookmarks/bookmarks_api.h" 5 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/i18n/file_util_icu.h" 9 #include "base/i18n/file_util_icu.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const BookmarkNode* node; 182 const BookmarkNode* node;
183 if (url_string.length()) 183 if (url_string.length())
184 node = model->AddURLWithCreationTimeAndMetaInfo( 184 node = model->AddURLWithCreationTimeAndMetaInfo(
185 parent, index, title, url, base::Time::Now(), meta_info); 185 parent, index, title, url, base::Time::Now(), meta_info);
186 else 186 else
187 node = model->AddFolderWithMetaInfo(parent, index, title, meta_info); 187 node = model->AddFolderWithMetaInfo(parent, index, title, meta_info);
188 DCHECK(node); 188 DCHECK(node);
189 if (!node) { 189 if (!node) {
190 error_ = keys::kNoNodeError; 190 error_ = keys::kNoNodeError;
191 return NULL; 191 return NULL;
192 } else if (!details.url.get()) {
193 model->SetDateFolderModified(parent, base::Time::Now());
Ken Rockot(use gerrit already) 2015/04/28 03:14:39 This looks like the wrong code to change. Shouldn'
Deepak 2015/04/28 11:23:33 I have done changes due to 2 reasons: 1) I have fo
192 } 194 }
193 195
194 return node; 196 return node;
195 } 197 }
196 198
197 bool BookmarksFunction::EditBookmarksEnabled() { 199 bool BookmarksFunction::EditBookmarksEnabled() {
198 PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile()); 200 PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile());
199 if (prefs->GetBoolean(::bookmarks::prefs::kEditBookmarksEnabled)) 201 if (prefs->GetBoolean(::bookmarks::prefs::kEditBookmarksEnabled))
200 return true; 202 return true;
201 error_ = keys::kEditBookmarksDisabled; 203 error_ = keys::kEditBookmarksDisabled;
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 } 847 }
846 848
847 void BookmarksExportFunction::FileSelected(const base::FilePath& path, 849 void BookmarksExportFunction::FileSelected(const base::FilePath& path,
848 int index, 850 int index,
849 void* params) { 851 void* params) {
850 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); 852 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL);
851 Release(); // Balanced in BookmarksIOFunction::SelectFile() 853 Release(); // Balanced in BookmarksIOFunction::SelectFile()
852 } 854 }
853 855
854 } // namespace extensions 856 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698