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

Side by Side Diff: chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc

Issue 257333002: Drive extension functions from ExtensionFunction::Run. The (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: appshell Created 6 years, 7 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/api/bookmark_manager_private/bookmark_manage r_private_api.h" 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); 433 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
434 const BookmarkNode* parent_node = GetNodeFromString(model, params->parent_id); 434 const BookmarkNode* parent_node = GetNodeFromString(model, params->parent_id);
435 if (!parent_node) { 435 if (!parent_node) {
436 error_ = bookmark_keys::kNoParentError; 436 error_ = bookmark_keys::kNoParentError;
437 return false; 437 return false;
438 } 438 }
439 model->SortChildren(parent_node); 439 model->SortChildren(parent_node);
440 return true; 440 return true;
441 } 441 }
442 442
443 bool BookmarkManagerPrivateGetStringsFunction::RunImpl() { 443 bool BookmarkManagerPrivateGetStringsFunction::RunAsync() {
444 base::DictionaryValue* localized_strings = new base::DictionaryValue(); 444 base::DictionaryValue* localized_strings = new base::DictionaryValue();
445 445
446 localized_strings->SetString("title", 446 localized_strings->SetString("title",
447 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TITLE)); 447 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TITLE));
448 localized_strings->SetString("search_button", 448 localized_strings->SetString("search_button",
449 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH_BUTTON)); 449 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH_BUTTON));
450 localized_strings->SetString("organize_menu", 450 localized_strings->SetString("organize_menu",
451 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU)); 451 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU));
452 localized_strings->SetString("show_in_folder", 452 localized_strings->SetString("show_in_folder",
453 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER)); 453 l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER));
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 result.enabled = undo_manager->redo_count() > 0; 786 result.enabled = undo_manager->redo_count() > 0;
787 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); 787 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel());
788 788
789 results_ = RedoInfo::Results::Create(result); 789 results_ = RedoInfo::Results::Create(result);
790 #endif // !defined(OS_ANDROID) 790 #endif // !defined(OS_ANDROID)
791 791
792 return true; 792 return true;
793 } 793 }
794 794
795 } // namespace extensions 795 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698