OLD | NEW |
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/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 scoped_ptr<ListValue> json(new ListValue()); | 506 scoped_ptr<ListValue> json(new ListValue()); |
507 if (params->folders_only) | 507 if (params->folders_only) |
508 bookmark_api_helpers::AddNodeFoldersOnly(node, json.get(), true); | 508 bookmark_api_helpers::AddNodeFoldersOnly(node, json.get(), true); |
509 else | 509 else |
510 bookmark_api_helpers::AddNode(node, json.get(), true); | 510 bookmark_api_helpers::AddNode(node, json.get(), true); |
511 SetResult(json.release()); | 511 SetResult(json.release()); |
512 return true; | 512 return true; |
513 } | 513 } |
514 | 514 |
515 bool BookmarkManagerPrivateCanEditFunction::RunImpl() { | 515 bool BookmarkManagerPrivateCanEditFunction::RunImpl() { |
516 PrefService* prefs = components::UserPrefs::Get(profile_); | 516 PrefService* prefs = user_prefs::UserPrefs::Get(profile_); |
517 SetResult(new base::FundamentalValue( | 517 SetResult(new base::FundamentalValue( |
518 prefs->GetBoolean(prefs::kEditBookmarksEnabled))); | 518 prefs->GetBoolean(prefs::kEditBookmarksEnabled))); |
519 return true; | 519 return true; |
520 } | 520 } |
521 | 521 |
522 bool BookmarkManagerPrivateRecordLaunchFunction::RunImpl() { | 522 bool BookmarkManagerPrivateRecordLaunchFunction::RunImpl() { |
523 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); | 523 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); |
524 return true; | 524 return true; |
525 } | 525 } |
526 | 526 |
527 bool BookmarkManagerPrivateCanOpenNewWindowsFunction::RunImpl() { | 527 bool BookmarkManagerPrivateCanOpenNewWindowsFunction::RunImpl() { |
528 bool can_open_new_windows = true; | 528 bool can_open_new_windows = true; |
529 | 529 |
530 #if defined(OS_WIN) | 530 #if defined(OS_WIN) |
531 if (win8::IsSingleWindowMetroMode()) | 531 if (win8::IsSingleWindowMetroMode()) |
532 can_open_new_windows = false; | 532 can_open_new_windows = false; |
533 #endif // OS_WIN | 533 #endif // OS_WIN |
534 | 534 |
535 SetResult(new base::FundamentalValue(can_open_new_windows)); | 535 SetResult(new base::FundamentalValue(can_open_new_windows)); |
536 return true; | 536 return true; |
537 } | 537 } |
538 | 538 |
539 } // namespace extensions | 539 } // namespace extensions |
OLD | NEW |