| 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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "content/public/browser/web_contents_view.h" | 33 #include "content/public/browser/web_contents_view.h" |
| 34 #include "content/public/browser/web_ui.h" | 34 #include "content/public/browser/web_ui.h" |
| 35 #include "extensions/browser/extension_function_dispatcher.h" | 35 #include "extensions/browser/extension_function_dispatcher.h" |
| 36 #include "extensions/browser/view_type_utils.h" | 36 #include "extensions/browser/view_type_utils.h" |
| 37 #include "grit/generated_resources.h" | 37 #include "grit/generated_resources.h" |
| 38 #include "ui/base/dragdrop/drag_drop_types.h" | 38 #include "ui/base/dragdrop/drag_drop_types.h" |
| 39 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
| 40 #include "ui/base/webui/web_ui_util.h" | 40 #include "ui/base/webui/web_ui_util.h" |
| 41 | 41 |
| 42 #if defined(OS_WIN) | |
| 43 #include "win8/util/win8_util.h" | |
| 44 #endif // OS_WIN | |
| 45 | |
| 46 namespace extensions { | 42 namespace extensions { |
| 47 | 43 |
| 48 namespace bookmark_keys = bookmark_api_constants; | 44 namespace bookmark_keys = bookmark_api_constants; |
| 49 namespace bookmark_manager_private = api::bookmark_manager_private; | 45 namespace bookmark_manager_private = api::bookmark_manager_private; |
| 50 namespace CanPaste = api::bookmark_manager_private::CanPaste; | 46 namespace CanPaste = api::bookmark_manager_private::CanPaste; |
| 51 namespace Copy = api::bookmark_manager_private::Copy; | 47 namespace Copy = api::bookmark_manager_private::Copy; |
| 52 namespace Cut = api::bookmark_manager_private::Cut; | 48 namespace Cut = api::bookmark_manager_private::Cut; |
| 53 namespace Drop = api::bookmark_manager_private::Drop; | 49 namespace Drop = api::bookmark_manager_private::Drop; |
| 54 namespace GetSubtree = api::bookmark_manager_private::GetSubtree; | 50 namespace GetSubtree = api::bookmark_manager_private::GetSubtree; |
| 55 namespace GetMetaInfo = api::bookmark_manager_private::GetMetaInfo; | 51 namespace GetMetaInfo = api::bookmark_manager_private::GetMetaInfo; |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 if (!node) | 618 if (!node) |
| 623 return false; | 619 return false; |
| 624 | 620 |
| 625 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); | 621 BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile()); |
| 626 model->SetNodeMetaInfo(node, params->key, params->value); | 622 model->SetNodeMetaInfo(node, params->key, params->value); |
| 627 return true; | 623 return true; |
| 628 } | 624 } |
| 629 | 625 |
| 630 bool BookmarkManagerPrivateCanOpenNewWindowsFunction::RunImpl() { | 626 bool BookmarkManagerPrivateCanOpenNewWindowsFunction::RunImpl() { |
| 631 bool can_open_new_windows = true; | 627 bool can_open_new_windows = true; |
| 632 | |
| 633 #if defined(OS_WIN) | |
| 634 if (win8::IsSingleWindowMetroMode()) | |
| 635 can_open_new_windows = false; | |
| 636 #endif // OS_WIN | |
| 637 | |
| 638 SetResult(new base::FundamentalValue(can_open_new_windows)); | 628 SetResult(new base::FundamentalValue(can_open_new_windows)); |
| 639 return true; | 629 return true; |
| 640 } | 630 } |
| 641 | 631 |
| 642 bool BookmarkManagerPrivateRemoveTreesFunction::RunImpl() { | 632 bool BookmarkManagerPrivateRemoveTreesFunction::RunImpl() { |
| 643 scoped_ptr<RemoveTrees::Params> params(RemoveTrees::Params::Create(*args_)); | 633 scoped_ptr<RemoveTrees::Params> params(RemoveTrees::Params::Create(*args_)); |
| 644 EXTENSION_FUNCTION_VALIDATE(params); | 634 EXTENSION_FUNCTION_VALIDATE(params); |
| 645 | 635 |
| 646 #if !defined(OS_ANDROID) | 636 #if !defined(OS_ANDROID) |
| 647 ScopedGroupBookmarkActions group_deletes(GetProfile()); | 637 ScopedGroupBookmarkActions group_deletes(GetProfile()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 result.enabled = undo_manager->redo_count() > 0; | 690 result.enabled = undo_manager->redo_count() > 0; |
| 701 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); | 691 result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel()); |
| 702 | 692 |
| 703 results_ = RedoInfo::Results::Create(result); | 693 results_ = RedoInfo::Results::Create(result); |
| 704 #endif // !defined(OS_ANDROID) | 694 #endif // !defined(OS_ANDROID) |
| 705 | 695 |
| 706 return true; | 696 return true; |
| 707 } | 697 } |
| 708 | 698 |
| 709 } // namespace extensions | 699 } // namespace extensions |
| OLD | NEW |