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

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

Issue 3197009: Remove wstrings in bookmarks, part 10. (Closed)
Patch Set: Created 10 years, 4 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 | « chrome/browser/bookmarks/bookmark_utils_unittest.cc ('k') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extension_bookmarks_module.h" 5 #include "chrome/browser/extensions/extension_bookmarks_module.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 bool SearchBookmarksFunction::RunImpl() { 324 bool SearchBookmarksFunction::RunImpl() {
325 string16 query; 325 string16 query;
326 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &query)); 326 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &query));
327 327
328 BookmarkModel* model = profile()->GetBookmarkModel(); 328 BookmarkModel* model = profile()->GetBookmarkModel();
329 ListValue* json = new ListValue(); 329 ListValue* json = new ListValue();
330 std::wstring lang = 330 std::wstring lang =
331 UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)); 331 UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages));
332 std::vector<const BookmarkNode*> nodes; 332 std::vector<const BookmarkNode*> nodes;
333 bookmark_utils::GetBookmarksContainingText(model, UTF16ToWideHack(query), 333 bookmark_utils::GetBookmarksContainingText(model, query,
334 std::numeric_limits<int>::max(), 334 std::numeric_limits<int>::max(),
335 lang, &nodes); 335 lang, &nodes);
336 std::vector<const BookmarkNode*>::iterator i = nodes.begin(); 336 std::vector<const BookmarkNode*>::iterator i = nodes.begin();
337 for (; i != nodes.end(); ++i) { 337 for (; i != nodes.end(); ++i) {
338 const BookmarkNode* node = *i; 338 const BookmarkNode* node = *i;
339 extension_bookmark_helpers::AddNode(node, json, false); 339 extension_bookmark_helpers::AddNode(node, json, false);
340 } 340 }
341 341
342 result_.reset(json); 342 result_.reset(json);
343 return true; 343 return true;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE); 819 SelectFile(SelectFileDialog::SELECT_SAVEAS_FILE);
820 return true; 820 return true;
821 } 821 }
822 822
823 void ExportBookmarksFunction::FileSelected(const FilePath& path, 823 void ExportBookmarksFunction::FileSelected(const FilePath& path,
824 int index, 824 int index,
825 void* params) { 825 void* params) {
826 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); 826 bookmark_html_writer::WriteBookmarks(profile(), path, NULL);
827 Release(); // Balanced in BookmarksIOFunction::SelectFile() 827 Release(); // Balanced in BookmarksIOFunction::SelectFile()
828 } 828 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698