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

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

Issue 2152373003: [Extensions] Code Cleanup - Remove redundant smart-ptr get()s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } else { 163 } else {
164 index = *details.index; 164 index = *details.index;
165 if (index > parent->child_count() || index < 0) { 165 if (index > parent->child_count() || index < 0) {
166 error_ = keys::kInvalidIndexError; 166 error_ = keys::kInvalidIndexError;
167 return NULL; 167 return NULL;
168 } 168 }
169 } 169 }
170 170
171 base::string16 title; // Optional. 171 base::string16 title; // Optional.
172 if (details.title.get()) 172 if (details.title.get())
173 title = base::UTF8ToUTF16(*details.title.get()); 173 title = base::UTF8ToUTF16(*details.title);
174 174
175 std::string url_string; // Optional. 175 std::string url_string; // Optional.
176 if (details.url.get()) 176 if (details.url.get())
177 url_string = *details.url.get(); 177 url_string = *details.url;
178 178
179 GURL url(url_string); 179 GURL url(url_string);
180 if (!url_string.empty() && !url.is_valid()) { 180 if (!url_string.empty() && !url.is_valid()) {
181 error_ = keys::kInvalidUrlError; 181 error_ = keys::kInvalidUrlError;
182 return NULL; 182 return NULL;
183 } 183 }
184 184
185 const BookmarkNode* node; 185 const BookmarkNode* node;
186 if (url_string.length()) { 186 if (url_string.length()) {
187 node = model->AddURLWithCreationTimeAndMetaInfo( 187 node = model->AddURLWithCreationTimeAndMetaInfo(
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 } 839 }
840 840
841 void BookmarksExportFunction::FileSelected(const base::FilePath& path, 841 void BookmarksExportFunction::FileSelected(const base::FilePath& path,
842 int index, 842 int index,
843 void* params) { 843 void* params) {
844 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); 844 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL);
845 Release(); // Balanced in BookmarksIOFunction::SelectFile() 845 Release(); // Balanced in BookmarksIOFunction::SelectFile()
846 } 846 }
847 847
848 } // namespace extensions 848 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698