diff options
-rw-r--r-- | chrome/browser/bookmarks/bookmark_utils.cc | 41 | ||||
-rw-r--r-- | chrome/browser/browser.scons | 1 | ||||
-rw-r--r-- | chrome/chrome.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 39 |
4 files changed, 45 insertions, 40 deletions
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index d6a83691..8c7f731d 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -4,6 +4,8 @@ #include "chrome/browser/bookmarks/bookmark_utils.h" +#include "base/basictypes.h" +#include "base/gfx/native_widget_types.h" #include "base/string_util.h" #include "base/time.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" @@ -13,15 +15,21 @@ #include "chrome/browser/history/query_parser.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/page_navigator.h" -#include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/drag_drop_types.h" #include "chrome/common/l10n_util.h" -#include "chrome/common/os_exchange_data.h" #include "chrome/views/event.h" #include "chrome/views/tree_node_iterator.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +// TODO(port): Port these files. +#if defined(OS_WIN) +#include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/common/os_exchange_data.h" +#else +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + namespace { // A PageNavigator implementation that creates a new Browser. This is used when @@ -127,7 +135,7 @@ void OpenAllImpl(BookmarkNode* node, } } -bool ShouldOpenAll(HWND parent, const std::vector<BookmarkNode*>& nodes) { +bool ShouldOpenAll(gfx::NativeWindow parent, const std::vector<BookmarkNode*>& nodes) { int descendant_count = 0; for (size_t i = 0; i < nodes.size(); ++i) descendant_count += DescendantURLCount(nodes[i]); @@ -137,9 +145,15 @@ bool ShouldOpenAll(HWND parent, const std::vector<BookmarkNode*>& nodes) { std::wstring message = l10n_util::GetStringF(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL, IntToWString(descendant_count)); +#if defined(OS_WIN) return MessageBox(parent, message.c_str(), l10n_util::GetString(IDS_PRODUCT_NAME).c_str(), MB_YESNO | MB_ICONWARNING | MB_TOPMOST) == IDYES; +#else + // TODO(port): Display a dialog prompt. + NOTIMPLEMENTED(); + return true; +#endif } // Comparison function that compares based on date modified of the two nodes. @@ -231,7 +245,7 @@ void CloneDragData(BookmarkModel* model, CloneDragDataImpl(model, elements[i], parent, index_to_add_at + i); } -void OpenAll(HWND parent, +void OpenAll(gfx::NativeWindow parent, Profile* profile, PageNavigator* navigator, const std::vector<BookmarkNode*>& nodes, @@ -256,7 +270,7 @@ void OpenAll(HWND parent, OpenAllImpl(nodes[i], initial_disposition, &navigator, &opened_url); } -void OpenAll(HWND parent, +void OpenAll(gfx::NativeWindow parent, Profile* profile, PageNavigator* navigator, BookmarkNode* node, @@ -272,10 +286,16 @@ void CopyToClipboard(BookmarkModel* model, if (nodes.empty()) return; +#if defined(OS_WIN) OSExchangeData* data = new OSExchangeData(); BookmarkDragData(nodes).Write(NULL, data); OleSetClipboard(data); // OLE takes ownership of OSExchangeData. +#else + // TODO(port): Clipboard integration. Don't we have clipboard + // implemented somewhere else? + NOTIMPLEMENTED(); +#endif if (remove_nodes) { for (size_t i = 0; i < nodes.size(); ++i) { @@ -291,6 +311,7 @@ void PasteFromClipboard(BookmarkModel* model, if (!parent) return; +#if defined(OS_WIN) IDataObject* data; if (OleGetClipboard(&data) != S_OK) return; @@ -303,12 +324,17 @@ void PasteFromClipboard(BookmarkModel* model, if (index == -1) index = parent->GetChildCount(); bookmark_utils::CloneDragData(model, bookmark_data.elements, parent, index); +#else + // TODO(port): Clipboard integration. + NOTIMPLEMENTED(); +#endif } bool CanPasteFromClipboard(BookmarkNode* node) { if (!node) return false; +#if defined(OS_WIN) IDataObject* data; if (OleGetClipboard(&data) != S_OK) return false; @@ -316,6 +342,11 @@ bool CanPasteFromClipboard(BookmarkNode* node) { OSExchangeData data_wrapper(data); BookmarkDragData bookmark_data; return bookmark_data.Read(data_wrapper); +#else + // TODO(port): Clipboard integration. + NOTIMPLEMENTED(); + return false; +#endif } std::vector<BookmarkNode*> GetMostRecentlyModifiedGroups( diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index d5d1063..c39fd5d 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -673,7 +673,6 @@ if not env.Bit('windows'): 'bookmarks/bookmark_context_menu.cc', 'bookmarks/bookmark_drag_data.cc', 'bookmarks/bookmark_drop_info.cc', - 'bookmarks/bookmark_utils.cc', 'browser_accessibility.cc', 'browser_accessibility_manager.cc', 'chrome_plugin_host.cc', diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index 866289a..eb0192d 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -250,6 +250,7 @@ 534E66C40F311BEC0006B2B2 /* temp_scaffolding_stubs.cc in Sources */ = {isa = PBXBuildFile; fileRef = 534E66C30F311BEC0006B2B2 /* temp_scaffolding_stubs.cc */; }; 544FBC49CB83E458B6B7069D /* test_web_contents.cc in Sources */ = {isa = PBXBuildFile; fileRef = 56E1D7DF17D327BFCB0B895D /* test_web_contents.cc */; }; 5DD7664089E8660524ED1CBC /* child_thread.cc in Sources */ = {isa = PBXBuildFile; fileRef = E81681ADC802675FE949BC63 /* child_thread.cc */; }; + 5F7E489192999F405D65D2E5 /* bookmark_utils.cc in Sources */ = {isa = PBXBuildFile; fileRef = A2FC5EE73E0DE8BF6C1C4C0F /* bookmark_utils.cc */; }; 623E5BE905E098E8280304DA /* dns_master_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFA6F0E9D4981009A6919 /* dns_master_unittest.cc */; }; 651621527E9FCD7FB5AF2E14 /* child_process_host.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5EE47CAC5E11F4B35E564CCE /* child_process_host.cc */; }; 65930533A98EF22451EEA01D /* history_publisher_none.cc in Sources */ = {isa = PBXBuildFile; fileRef = 7849CCC221723C1BC14D6384 /* history_publisher_none.cc */; }; @@ -2482,6 +2483,7 @@ 844EA0810F3E0C1000B0EF26 /* debugger_window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = debugger_window.h; path = debugger/debugger_window.h; sourceTree = "<group>"; }; 844EA0820F3E0C1000B0EF26 /* debugger_wrapper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debugger_wrapper.cc; path = debugger/debugger_wrapper.cc; sourceTree = "<group>"; }; 844EA0830F3E0C1000B0EF26 /* debugger_wrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = debugger_wrapper.h; path = debugger/debugger_wrapper.h; sourceTree = "<group>"; }; + A2FC5EE73E0DE8BF6C1C4C0F /* bookmark_utils.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bookmark_utils.cc; path = browser/bookmarks/bookmark_utils.cc; sourceTree = SOURCE_ROOT; }; A54612D90EE9957000A8EE5D /* extensions_service.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extensions_service.cc; sourceTree = "<group>"; }; A54612DA0EE9957000A8EE5D /* extensions_service.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extensions_service.h; sourceTree = "<group>"; }; A54612DB0EE9958600A8EE5D /* extensions_service_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extensions_service_unittest.cc; sourceTree = "<group>"; }; @@ -3176,6 +3178,7 @@ D3C3DAA911D390A33D06B0B0 /* history_url_provider.cc */, 4F3E216FC08B4749FC8C2ED5 /* autocomplete.cc */, 0114EE7E1097BDFBF94057E6 /* search_provider.cc */, + A2FC5EE73E0DE8BF6C1C4C0F /* bookmark_utils.cc */, ); sourceTree = "<group>"; }; @@ -5458,6 +5461,7 @@ 81E4783DE6F497B9BCC5B9F6 /* bookmark_model.cc in Sources */, A0BC9272AD709E86D492DAEC /* bookmark_storage.cc in Sources */, E40CC5F70F2E351A00708647 /* bookmark_table_model.cc in Sources */, + 5F7E489192999F405D65D2E5 /* bookmark_utils.cc in Sources */, E46C4C2E0F212CAF00B393B8 /* browser.cc in Sources */, 6685F5375CC4ECE98C4C2213 /* browser_about_handler.cc in Sources */, B61C4C1F0F3284A700489E0F /* browser_init.cc in Sources */, diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 5ee46e0..5019c3c 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -16,7 +16,7 @@ #include "base/singleton.h" #include "base/task.h" #include "chrome/browser/autocomplete/history_url_provider.h" -#include "chrome/browser/bookmarks/bookmark_utils.h" +#include "chrome/browser/bookmarks/bookmark_drag_data.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/cache_manager_host.h" @@ -355,44 +355,15 @@ void DebuggerShell::ProcessCommand(const std::wstring& data) { } #endif // !CHROME_DEBUGGER_DISABLED -namespace bookmark_utils { - -bool DoesBookmarkContainText(BookmarkNode* node, const std::wstring& text) { +bool BookmarkDragData::IsFromProfile(Profile* profile) const { NOTIMPLEMENTED(); return false; } -void GetMostRecentlyAddedEntries(BookmarkModel* model, - size_t count, - std::vector<BookmarkNode*>* nodes) { - NOTIMPLEMENTED(); -} - -std::vector<BookmarkNode*> GetMostRecentlyModifiedGroups(BookmarkModel* model, - size_t max_count) { - NOTIMPLEMENTED(); - return std::vector<BookmarkNode*>(); -} - -void GetBookmarksContainingText(BookmarkModel* model, - const std::wstring& text, - size_t max_count, - std::vector<BookmarkNode*>* nodes) { - NOTIMPLEMENTED(); -} - -void GetBookmarksMatchingText(BookmarkModel* model, - const std::wstring& text, - size_t max_count, - std::vector<TitleMatch>* matches) { - NOTIMPLEMENTED(); -} - -bool MoreRecentlyAdded(BookmarkNode* n1, BookmarkNode* n2) { +std::vector<BookmarkNode*> BookmarkDragData::GetNodes(Profile* profile) const { + std::vector<BookmarkNode*> nodes; NOTIMPLEMENTED(); - return false; -} - + return nodes; } ScopableCPRequest::~ScopableCPRequest() { |