diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 14:11:52 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-05 14:11:52 +0000 |
commit | e3e4c20194dd6efea907b4104284756fece37653 (patch) | |
tree | d952e270859222909d8bd39ad85cbec4c433a781 | |
parent | fa34a7a36eef3100f3de056ebe79cb55fd62cf09 (diff) | |
download | chromium_src-e3e4c20194dd6efea907b4104284756fece37653.zip chromium_src-e3e4c20194dd6efea907b4104284756fece37653.tar.gz chromium_src-e3e4c20194dd6efea907b4104284756fece37653.tar.bz2 |
Get history and download HTML UIs into Mac/Linux builds along with supporting icon scaffolding.
Review URL: http://codereview.chromium.org/39132
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10986 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.scons | 4 | ||||
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_contents.cc | 16 | ||||
-rw-r--r-- | chrome/browser/dom_ui/downloads_ui.cc | 7 | ||||
-rw-r--r-- | chrome/browser/dom_ui/fileicon_source.h | 8 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 8 | ||||
-rw-r--r-- | chrome/chrome.gyp | 10 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 8 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 27 |
8 files changed, 59 insertions, 29 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index b18808c..9990442 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -399,6 +399,10 @@ input_files = ChromeFileList([ 'dom_ui/dom_ui_contents.h', 'dom_ui/dom_ui_host.cc', 'dom_ui/dom_ui_host.h', + 'dom_ui/downloads_ui.cc', + 'dom_ui/downloads_ui.h', + 'dom_ui/fileicon_source.cc', + 'dom_ui/fileicon_source.h', 'dom_ui/history_ui.cc', 'dom_ui/history_ui.h', 'dom_ui/html_dialog_contents.cc', diff --git a/chrome/browser/dom_ui/dom_ui_contents.cc b/chrome/browser/dom_ui/dom_ui_contents.cc index a60978f..ce73635 100644 --- a/chrome/browser/dom_ui/dom_ui_contents.cc +++ b/chrome/browser/dom_ui/dom_ui_contents.cc @@ -275,17 +275,21 @@ DOMUI* DOMUIContents::GetDOMUIForURL(const GURL &url) { url.SchemeIs(chrome::kChromeInternalScheme)) { return new NewTabUI(this); } -#if defined(OS_WIN) -// TODO(port): include this once these are converted to HTML if (url.host() == HistoryUI::GetBaseURL().host()) { return new HistoryUI(this); - } else if (url.host() == DownloadsUI::GetBaseURL().host()) { + } + if (url.host() == DownloadsUI::GetBaseURL().host()) { return new DownloadsUI(this); - } else if (url.host() == ExtensionsUI::GetBaseURL().host()) { + } +#if defined(OS_WIN) +// TODO(port): include this once these are converted to HTML + if (url.host() == ExtensionsUI::GetBaseURL().host()) { return new ExtensionsUI(this); - } else if (url.host() == DebuggerContents::GetBaseURL().host()) { + } + if (url.host() == DebuggerContents::GetBaseURL().host()) { return new DebuggerContents(this); - } else if (url.host() == DevToolsUI::GetBaseURL().host()) { + } + if (url.host() == DevToolsUI::GetBaseURL().host()) { return new DevToolsUI(this); } #else diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc index c7cdcd7..35b9096 100644 --- a/chrome/browser/dom_ui/downloads_ui.cc +++ b/chrome/browser/dom_ui/downloads_ui.cc @@ -11,7 +11,10 @@ #include "base/time_format.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/dom_ui/fileicon_source.h" +#if defined(OS_WIN) +// TODO(port): re-enable when download_util is ported #include "chrome/browser/download/download_util.h" +#endif #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profile.h" #include "chrome/common/jstemplate_builder.h" @@ -112,8 +115,8 @@ class DownloadItemSorter : public std::binary_function<DownloadItem*, DownloadsDOMHandler::DownloadsDOMHandler(DOMUI* dom_ui, DownloadManager* dlm) : DOMMessageHandler(dom_ui), - download_manager_(dlm), - search_text_() { + search_text_(), + download_manager_(dlm) { dom_ui_->RegisterMessageCallback("getDownloads", NewCallback(this, &DownloadsDOMHandler::HandleGetDownloads)); dom_ui_->RegisterMessageCallback("openFile", diff --git a/chrome/browser/dom_ui/fileicon_source.h b/chrome/browser/dom_ui/fileicon_source.h index e56996c..7fdfb94 100644 --- a/chrome/browser/dom_ui/fileicon_source.h +++ b/chrome/browser/dom_ui/fileicon_source.h @@ -6,9 +6,15 @@ #define CHROME_BROWSER_DOM_UI_FILEICON_SOURCE_H_ #include "chrome/browser/dom_ui/chrome_url_data_manager.h" -#include "chrome/browser/icon_manager.h" #include "chrome/common/resource_bundle.h" +#if defined(OS_WIN) +#include "chrome/browser/icon_manager.h" +#else +// TODO(port): Remove when IconManager has been ported. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + class GURL; // FileIconSource is the gateway between network-level chrome: diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 105061b..34b3ba6 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -12,10 +12,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/dom_ui/dom_ui_contents.h" -#if defined(OS_WIN) -// TODO(port): include this once history is converted to HTML #include "chrome/browser/dom_ui/history_ui.h" -#endif #include "chrome/browser/history/page_usage_data.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/profile.h" @@ -718,15 +715,10 @@ HistoryHandler::HistoryHandler(DOMUI* dom_ui) void HistoryHandler::HandleShowHistoryPage(const Value*) { NavigationController* controller = dom_ui_->get_contents()->controller(); if (controller) { -#if defined(OS_WIN) -// TODO(port): include this once history is converted to HTML UserMetrics::RecordAction(L"NTP_ShowHistory", dom_ui_->get_profile()); controller->LoadURL(HistoryUI::GetBaseURL(), GURL(), PageTransition::LINK); // We are deleted by LoadURL, so do not call anything else. -#else - NOTIMPLEMENTED(); -#endif } } diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 09f79ec..38ee051 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1133,15 +1133,6 @@ ['include', '^browser/automation/automation_resource_tracker\\.cc$'], ['include', '^browser/automation/url_request_[^/]*_job\\.cc$'], - # Exclude most of dom_ui. - ['exclude', '^browser/dom_ui/'], - ['include', '^browser/dom_ui/chrome_url_data_manager\\.cc$'], - ['include', '^browser/dom_ui/dom_ui\\.cc$'], - ['include', '^browser/dom_ui/dom_ui_contents\\.cc$'], - ['include', '^browser/dom_ui/dom_ui_host\\.cc$'], - ['include', '^browser/dom_ui/history_ui\\.cc$'], - ['include', '^browser/dom_ui/new_tab_ui\\.cc$'], - # Exclude most of download. ['exclude', '^browser/download/'], ['include', '^browser/download/download_(file|manager|shelf)\\.cc$'], @@ -1174,6 +1165,7 @@ 'browser/bookmarks/bookmark_drop_info.cc', 'browser/debugger/debugger_view.cc', 'browser/debugger/debugger_window.cc', + 'browser/dom_ui/html_dialog_contents.cc', 'browser/importer/ie_importer.cc', 'browser/tab_contents/render_view_context_menu_controller.cc', 'browser/tab_contents/web_drag_source.cc', diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 96a7bed..a1727c8 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -531,3 +531,11 @@ views::Window* CreateInputWindow(gfx::NativeWindow parent_hwnd, return new views::Window(); } +namespace download_util { + +void DragDownload(const DownloadItem* download, SkBitmap* icon) { + NOTIMPLEMENTED(); +} + +} // namespace download_util + diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 1b7d1e2..e8f10ca 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -254,9 +254,6 @@ class BrokerServices { } // namespace sandbox -class IconManager { -}; - struct ViewHostMsg_DidPrintPage_Params; namespace views { @@ -395,6 +392,30 @@ class BookmarkBarView { //--------------------------------------------------------------------------- // These stubs are for Browser +namespace download_util { +void DragDownload(const DownloadItem* download, SkBitmap* icon); +} // namespace download_util + +class IconLoader { + public: + enum IconSize { + SMALL = 0, // 16x16 + NORMAL, // 32x32 + LARGE + }; +}; + +class IconManager : public CancelableRequestProvider { + public: + typedef CancelableRequestProvider::Handle Handle; + typedef Callback2<Handle, SkBitmap*>::Type IconRequestCallback; + SkBitmap* LookupIcon(const std::wstring&, IconLoader::IconSize) + { NOTIMPLEMENTED(); return NULL; } + Handle LoadIcon(const std::wstring&, IconLoader::IconSize, + CancelableRequestConsumerBase*, IconRequestCallback*) + { NOTIMPLEMENTED(); return NULL; } +}; + class DebuggerWindow : public base::RefCountedThreadSafe<DebuggerWindow> { public: }; |