diff options
author | serya@google.com <serya@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-25 12:02:24 +0000 |
---|---|---|
committer | serya@google.com <serya@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-25 12:02:24 +0000 |
commit | 5947fd89b8db8fbc017bfbcef92a7349db49b05b (patch) | |
tree | b2d640248a4fbea98c9cb06f4ff8a5a4b65d679e | |
parent | 3bd3ac8c075cb0f00d84a561f02774853fae779a (diff) | |
download | chromium_src-5947fd89b8db8fbc017bfbcef92a7349db49b05b.zip chromium_src-5947fd89b8db8fbc017bfbcef92a7349db49b05b.tar.gz chromium_src-5947fd89b8db8fbc017bfbcef92a7349db49b05b.tar.bz2 |
Moving slideshow to extension.
TEST=none
BUG=chromium-os:11430
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82509
Review URL: http://codereview.chromium.org/6873100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82851 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_resources.grd | 1 | ||||
-rw-r--r-- | chrome/browser/resources/component_extension_resources.grd | 1 | ||||
-rw-r--r-- | chrome/browser/resources/file_manager/background.html | 28 | ||||
-rw-r--r-- | chrome/browser/resources/file_manager/js/file_manager.js | 15 | ||||
-rw-r--r-- | chrome/browser/resources/file_manager/manifest.json | 16 | ||||
-rw-r--r-- | chrome/browser/resources/file_manager/slideshow.html | 239 | ||||
-rw-r--r-- | chrome/browser/resources/shared_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chrome_web_ui_factory.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/webui/slideshow_ui.cc | 284 | ||||
-rw-r--r-- | chrome/browser/ui/webui/slideshow_ui.h | 19 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 3 |
11 files changed, 277 insertions, 338 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 2e863db..c3d0b4d 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -105,7 +105,6 @@ <include name="IDR_OFFLINE_LOAD_HTML" file="resources\offline_load.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_OS_CREDITS_HTML" file="resources\about_os_credits.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_PROXY_SETTINGS_HTML" file="resources\chromeos\proxy_settings.html" flattenhtml="true" type="BINDATA" /> - <include name="IDR_SLIDESHOW_HTML" file="resources\slideshow.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SIM_UNLOCK_HTML" file="resources\chromeos\sim_unlock.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_MENU_HTML" file="resources\menu.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_NETWORK_MENU_CSS" file="resources\network_menu.css" flattenhtml="true" type="BINDATA" /> diff --git a/chrome/browser/resources/component_extension_resources.grd b/chrome/browser/resources/component_extension_resources.grd index 77dc9bb9b..6004de7 100644 --- a/chrome/browser/resources/component_extension_resources.grd +++ b/chrome/browser/resources/component_extension_resources.grd @@ -23,6 +23,7 @@ <if expr="pp_ifdef('file_manager_extension')"> <include name="IDR_FILE_MANAGER_MAIN" file="file_manager/main.html" flattenhtml="true" type="BINDATA" /> + <include name="IDR_FILE_MANAGER_SLIDESHOW" file="file_manager/slideshow.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_FILE_MANAGER_EXIF_READER" file="file_manager/js/exif_reader.js" type="BINDATA" /> <include name="IDR_PICASA_UPLOAD_PAGE" file="picasaweb_uploader/upload.html" flattenhtml="true" type="BINDATA" /> diff --git a/chrome/browser/resources/file_manager/background.html b/chrome/browser/resources/file_manager/background.html deleted file mode 100644 index 1c9f88d..0000000 --- a/chrome/browser/resources/file_manager/background.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE HTML> -<!-- - -- Copyright (c) 2011 The Chromium Authors. All rights reserved. - -- Use of this source code is governed by a BSD-style license that can be - -- found in the LICENSE file. - --> -<html> -<head> -<script> - -var last_file_entries = null; - -function getLastFileEntries() { - return last_file_entries; -} - -chrome.fileBrowserHandler.onExecute.addListener( - function(id, file_entries) { - last_file_entries = file_entries; - - chrome.tabs.create({ - url: "slideshow.html" - }); - } -); -</script> -</body> -</html> diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js index a2a7886..a70a520 100644 --- a/chrome/browser/resources/file_manager/js/file_manager.js +++ b/chrome/browser/resources/file_manager/js/file_manager.js @@ -8,6 +8,8 @@ const ENABLE_EXIF_READER = false; // TODO(rginda): Remove this when the thumbnail view is less janky. const ENABLE_THUMBNAIL_VIEW = false; +var g_slideshow_data = null; + /** * FileManager constructor. * @@ -975,7 +977,20 @@ FileManager.prototype = { } }; + FileManager.prototype.getExtensionId_ = function() { + return chrome.extension.getURL('').split('/')[2]; + }; + FileManager.prototype.onTaskButtonClicked_ = function(event) { + // TODO(serya): This API assumes having a background page. + // Adding it crashes a few of browser tests (they wonder + // to see a new renderer process in a fresh profile). + if (event.srcElement.task.taskId == this.getExtensionId_() + '|preview') { + g_slideshow_data = this.selection.urls; + alert("create tab"); + chrome.tabs.create({url: "slideshow.html"}); + return; + } chrome.fileBrowserPrivate.executeTask(event.srcElement.task.taskId, this.selection.urls); } diff --git a/chrome/browser/resources/file_manager/manifest.json b/chrome/browser/resources/file_manager/manifest.json index 7d894c6..dc4c7d9 100644 --- a/chrome/browser/resources/file_manager/manifest.json +++ b/chrome/browser/resources/file_manager/manifest.json @@ -13,5 +13,21 @@ "fileBrowserPrivate", "chrome://extension-icon/", "chrome://resources/" + ], + "file_browser_handlers": [ + { + "id": "preview", + "default_title": "Preview image", + "file_filters": [ + "filesystem:*.gif", + "filesystem:*.jpg", + "filesystem:*.jpeg", + "filesystem:*.png", + "filesystem:*.GIF", + "filesystem:*.JPG", + "filesystem:*.JPEG", + "filesystem:*.PNG" + ] + } ] } diff --git a/chrome/browser/resources/file_manager/slideshow.html b/chrome/browser/resources/file_manager/slideshow.html new file mode 100644 index 0000000..4c40d39 --- /dev/null +++ b/chrome/browser/resources/file_manager/slideshow.html @@ -0,0 +1,239 @@ +<!DOCTYPE HTML> +<html i18n-values="dir:textdirection;"> +<head> +<meta charset="utf-8"> +<title>Slideshow</title> +<style> + +body { + overflow: hidden; + background: black; +} + +#glow { + left: 0; + right: 0; + bottom: 30px; + height: 8px; + opacity: .4; + position: absolute; + background: -webkit-linear-gradient(transparent, white); +} + +#main { + position: absolute; + left: 0; + right:0; + top: 0; + bottom: 30px; + overflow: hidden; +} + +#playercontrols { + bottom: 0; + left: 0; + z-index: 999; + height: 30px; + opacity: .9; + right: 0; + align:center; + -webkit-box-align: center; + -webkit-box-pack: center; + display: -webkit-box; + position: absolute; + background: -webkit-linear-gradient(#323232, #070707); +} + +#prevbutton > div { + background: url('chrome://resources/images/mediaplayer_prev.png'); + background-repeat: no-repeat; + background-position: 4px 8px; + width: 100%; + height: 30px; + z-index: 9999; +} + +.currentpicture { + width: 100%; + height: 100%; + position: absolute; + top: 0; + -webkit-transition-property: left; + -webkit-transition-duration: 1s; + display: -webkit-box; + -webkit-box-align: center; + -webkit-box-pack: center; + pointer-events: none; +} + +.comingfromleft { + left: -100%; +} + +.comingfromright { + left: 100%; +} + +#nextbutton > div { + background: url('chrome://resources/images/mediaplayer_next.png'); + background-repeat: no-repeat; + background-position: 4px 8px; + width: 100%; + height: 30px; + z-index: 9999; +} + +button { + z-index: 9999; + cursor: pointer; + width: 28px; + height: 30px; + webkit-appearance: none; + padding: 0; + border: 0; + background: transparent; +} + +button:hover { + background: -webkit-linear-gradient(#6a7eac, #000000); +} + +</style> +<script src="chrome://resources/js/local_strings.js"></script> +<script src="chrome://resources/js/media_common.js"></script> +<script> + +document.addEventListener('DOMContentLoaded', load); + +document.onselectstart = function(e) { + e.preventDefault(); +}; + +function $(o) { + return document.getElementById(o); +} + +/////////////////////////////////////////////////////////////////////////////// +// Document Functions: + +var currentPicture = null; +var prevPicture = null; +var currentFileOffset = 0; +var filelist = []; +var moveRight = false; +var lastimg = null; + +function loadedPicture() { + if (prevPicture) { + if (moveRight) { + prevPicture.style.left = '-100%'; + } else { + prevPicture.style.left = '100%'; + } + } + if (window.innerHeight < lastimg.height || + window.innerWidth < lastimg.width) { + if (lastimg.width > lastimg.height) { + lastimg.style.height = 'auto'; + lastimg.style.width = '100%'; + } else { + lastimg.style.width = 'auto'; + lastimg.style.height = '100%'; + } + } + setTimeout(function() { + currentPicture.style.left = '0'; + }, 10); +} + +function transitionTo(filePath, fromTheRight) { + if (currentPicture) { + if (prevPicture) { + $('main').removeChild(prevPicture); + } + prevPicture = currentPicture; + } + + currentPicture = document.createElement('div'); + + $('main').appendChild(currentPicture); + if (fromTheRight) { + currentPicture.className = 'currentpicture comingfromright'; + } else { + currentPicture.className = 'currentpicture comingfromleft'; + } + var image = document.createElement('img'); + lastimg = image; + image.onload = loadedPicture; + image.onerror = loadedPicture; + image.src = filePath; + currentPicture.appendChild(image); + moveRight = fromTheRight; +} + +function browseFileResult() { + currentFileOffset = 0; + if (filelist.length > 0) { + transitionTo(filelist[currentFileOffset], true); + } +} + +function keyPressed(e) { + // Left Pressed + if (e.keyCode == 37) { + if (currentFileOffset > 0) { + currentFileOffset--; + transitionTo(filelist[currentFileOffset], false); + } + } + // Right Pressed + if (e.keyCode == 39) { + if (currentFileOffset < (filelist.length - 1)) { + currentFileOffset++; + transitionTo(filelist[currentFileOffset], true); + } + } +} + +function load() { + localStrings = new LocalStrings(); + + var views = chrome.extension.getViews(); + for (var i = 0; i < views.length; i++) { + if (views[i].g_slideshow_data) { + filelist = views[i].g_slideshow_data; + views[i].g_slideshow_data = null; + } + } + + browseFileResult(); +} + +function prevButtonClick() { + if (currentFileOffset > 0) { + currentFileOffset--; + transitionTo(filelist[currentFileOffset], false); + } +} + +function nextButtonClick() { + if (currentFileOffset < (filelist.length - 1)) { + currentFileOffset++; + transitionTo(filelist[currentFileOffset], true); + } +} + +</script> +<body onkeydown="keyPressed(event)"> +<div id="main"></div> +<div id="glow"></div> +<div id="playercontrols"> + <button id="prevbutton" onclick="prevButtonClick()"> + <div></div> + </button> + <button id="nextbutton" onclick="nextButtonClick()"> + <div></div> + </button> +</div> +</body> +</html> diff --git a/chrome/browser/resources/shared_resources.grd b/chrome/browser/resources/shared_resources.grd index 97a6093..9a96a47 100644 --- a/chrome/browser/resources/shared_resources.grd +++ b/chrome/browser/resources/shared_resources.grd @@ -32,6 +32,10 @@ without changes to the corresponding grd file. paaaae --> file="shared/css/tree.css.js" type="BINDATA" /> <include name="IDR_SHARED_IMAGES_THROBBER" file="shared/images/throbber.svg" type="BINDATA" /> + <include name="IDR_SHARED_IMAGES_MEDIAPLAYER_PREV" + file="shared/images/mediaplayer_prev.png" type="BINDATA" /> + <include name="IDR_SHARED_IMAGES_MEDIAPLAYER_NEXT" + file="shared/images/mediaplayer_next.png" type="BINDATA" /> <include name="IDR_SHARED_JS_CR" file="shared/js/cr.js" type="BINDATA" /> <include name="IDR_SHARED_JS_CR_COMMAND_LINE" @@ -106,6 +110,8 @@ without changes to the corresponding grd file. paaaae --> file="shared/js/i18n_template.js" type="BINDATA" /> <include name="IDR_SHARED_JS_LOCAL_STRINGS" file="shared/js/local_strings.js" type="BINDATA" /> + <include name="IDR_SHARED_JS_MEDIA_COMMON" + file="shared/js/media_common.js" type="BINDATA" /> <include name="IDR_SHARED_JS_PARSE_HTML_SUBSET" file="shared/js/parse_html_subset.js" type="BINDATA" /> <include name="IDR_SHARED_JS_UTIL" diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_factory.cc index a06142f..c0d9805 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_factory.cc @@ -27,7 +27,6 @@ #include "chrome/browser/ui/webui/plugins_ui.h" #include "chrome/browser/ui/webui/print_preview_ui.h" #include "chrome/browser/ui/webui/remoting_ui.h" -#include "chrome/browser/ui/webui/slideshow_ui.h" #include "chrome/browser/ui/webui/sync_internals_ui.h" #include "chrome/browser/ui/webui/textfields_ui.h" #include "chrome/common/chrome_switches.h" @@ -202,8 +201,6 @@ static WebUIFactoryFunction GetWebUIFactoryFunction(Profile* profile, return &NewWebUI<RegisterPageUI>; if (url.host() == chrome::kChromeUISettingsHost) return &NewWebUI<OptionsUI>; - if (url.host() == chrome::kChromeUISlideshowHost) - return &NewWebUI<SlideshowUI>; if (url.host() == chrome::kChromeUISimUnlockHost) return &NewWebUI<chromeos::SimUnlockUI>; if (url.host() == chrome::kChromeUISystemInfoHost) diff --git a/chrome/browser/ui/webui/slideshow_ui.cc b/chrome/browser/ui/webui/slideshow_ui.cc deleted file mode 100644 index d44dec7..0000000 --- a/chrome/browser/ui/webui/slideshow_ui.cc +++ /dev/null @@ -1,284 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/slideshow_ui.h" - -#include "base/callback.h" -#include "base/memory/singleton.h" -#include "base/memory/weak_ptr.h" -#include "base/message_loop.h" -#include "base/path_service.h" -#include "base/string_piece.h" -#include "base/string_util.h" -#include "base/threading/thread.h" -#include "base/time.h" -#include "base/utf_string_conversions.h" -#include "base/values.h" -#include "chrome/browser/history/history_types.h" -#include "chrome/browser/metrics/user_metrics.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/favicon_source.h" -#include "chrome/common/chrome_paths.h" -#include "chrome/common/jstemplate_builder.h" -#include "chrome/common/url_constants.h" -#include "content/browser/browser_thread.h" -#include "content/browser/tab_contents/tab_contents.h" -#include "grit/browser_resources.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "grit/locale_settings.h" -#include "net/base/directory_lister.h" -#include "net/base/escape.h" -#include "ui/base/resource/resource_bundle.h" - -static const char kPropertyPath[] = "path"; -static const char kPropertyTitle[] = "title"; -static const char kPropertyOffset[] = "currentOffset"; -static const char kPropertyDirectory[] = "isDirectory"; - -class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource { - public: - SlideshowUIHTMLSource(); - - // Called when the network layer has requested a resource underneath - // the path we registered. - virtual void StartDataRequest(const std::string& path, - bool is_incognito, - int request_id); - virtual std::string GetMimeType(const std::string&) const { - return "text/html"; - } - - private: - ~SlideshowUIHTMLSource() {} - - DISALLOW_COPY_AND_ASSIGN(SlideshowUIHTMLSource); -}; - -// The handler for Javascript messages related to the "slideshow" view. -class SlideshowHandler : public net::DirectoryLister::DirectoryListerDelegate, - public WebUIMessageHandler, - public base::SupportsWeakPtr<SlideshowHandler> { - public: - SlideshowHandler(); - virtual ~SlideshowHandler(); - - // Init work after Attach. - void Init(); - - // DirectoryLister::DirectoryListerDelegate methods: - virtual void OnListFile( - const net::DirectoryLister::DirectoryListerData& data); - virtual void OnListDone(int error); - - // WebUIMessageHandler implementation. - virtual WebUIMessageHandler* Attach(WebUI* web_ui); - virtual void RegisterMessages(); - - void GetChildrenForPath(const FilePath& path, bool is_refresh); - - // Callback for the "getChildren" message. - void HandleGetChildren(const ListValue* args); - - void HandleRefreshDirectory(const ListValue* args); - - private: - bool PathIsImageFile(const char* filename); - - scoped_ptr<ListValue> filelist_value_; - FilePath currentpath_; - FilePath originalpath_; - Profile* profile_; - int counter_; - int currentOffset_; - scoped_refptr<net::DirectoryLister> lister_; - bool is_refresh_; - - DISALLOW_COPY_AND_ASSIGN(SlideshowHandler); -}; - -//////////////////////////////////////////////////////////////////////////////// -// -// SlideshowHTMLSource -// -//////////////////////////////////////////////////////////////////////////////// - -SlideshowUIHTMLSource::SlideshowUIHTMLSource() - : DataSource(chrome::kChromeUISlideshowHost, MessageLoop::current()) { -} - -void SlideshowUIHTMLSource::StartDataRequest(const std::string& path, - bool is_incognito, - int request_id) { - DictionaryValue localized_strings; - // TODO(dhg): Add stirings to localized strings, also add more strings - // that are currently hardcoded. - SetFontAndTextDirection(&localized_strings); - - static const base::StringPiece slideshow_html( - ResourceBundle::GetSharedInstance().GetRawDataResource( - IDR_SLIDESHOW_HTML)); - const std::string full_html = jstemplate_builder::GetI18nTemplateHtml( - slideshow_html, &localized_strings); - - scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); - html_bytes->data.resize(full_html.size()); - std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); - - SendResponse(request_id, html_bytes); -} - -//////////////////////////////////////////////////////////////////////////////// -// -// SlideshowHandler -// -//////////////////////////////////////////////////////////////////////////////// -SlideshowHandler::SlideshowHandler() - : profile_(NULL), - is_refresh_(false) { - lister_ = NULL; -} - -SlideshowHandler::~SlideshowHandler() { - if (lister_.get()) { - lister_->Cancel(); - lister_->set_delegate(NULL); - } -} - -WebUIMessageHandler* SlideshowHandler::Attach(WebUI* web_ui) { - profile_ = web_ui->GetProfile(); - // Create our favicon data source. - profile_->GetChromeURLDataManager()->AddDataSource( - new FaviconSource(profile_, FaviconSource::FAVICON)); - return WebUIMessageHandler::Attach(web_ui); -} - -void SlideshowHandler::Init() { -} - -void SlideshowHandler::RegisterMessages() { - web_ui_->RegisterMessageCallback("getChildren", - NewCallback(this, &SlideshowHandler::HandleGetChildren)); - web_ui_->RegisterMessageCallback("refreshDirectory", - NewCallback(this, &SlideshowHandler::HandleRefreshDirectory)); -} - -void SlideshowHandler::HandleRefreshDirectory(const ListValue* args) { -#if defined(OS_CHROMEOS) - std::string path = UTF16ToUTF8(ExtractStringValue(args)); - GetChildrenForPath(FilePath(path), true); -#endif -} - -void SlideshowHandler::GetChildrenForPath(const FilePath& path, - bool is_refresh) { - filelist_value_.reset(new ListValue()); - currentpath_ = path; - - if (lister_.get()) { - lister_->Cancel(); - lister_->set_delegate(NULL); - lister_ = NULL; - } - - is_refresh_ = is_refresh; - if (file_util::EnsureEndsWithSeparator(¤tpath_) && - currentpath_.IsAbsolute()) { - lister_ = new net::DirectoryLister(currentpath_, this); - } else { - originalpath_ = currentpath_; - currentpath_ = currentpath_.DirName(); - lister_ = new net::DirectoryLister(currentpath_, this); - } - counter_ = 0; - currentOffset_ = -1; - lister_->Start(); -} - -void SlideshowHandler::HandleGetChildren(const ListValue* args) { -#if defined(OS_CHROMEOS) - filelist_value_.reset(new ListValue()); - std::string path = UTF16ToUTF8(ExtractStringValue(args)); - GetChildrenForPath(FilePath(path), false); -#endif -} - -bool SlideshowHandler::PathIsImageFile(const char* filename) { -#if defined(OS_CHROMEOS) - FilePath file = FilePath(filename); - std::string ext = file.Extension(); - ext = StringToLowerASCII(ext); - if (ext == ".jpg" || - ext == ".jpeg" || - ext == ".png" || - ext == ".gif") { - return true; - } else { - return false; - } -#else - return false; -#endif -} - -void SlideshowHandler::OnListFile( - const net::DirectoryLister::DirectoryListerData& data) { -#if defined(OS_CHROMEOS) - if (data.info.filename[0] == '.') { - return; - } - if (!PathIsImageFile(data.info.filename.c_str())) { - return; - } - - DictionaryValue* file_value = new DictionaryValue(); - - file_value->SetString(kPropertyTitle, data.info.filename); - file_value->SetString(kPropertyPath, - currentpath_.Append(data.info.filename).value()); - file_value->SetBoolean(kPropertyDirectory, S_ISDIR(data.info.stat.st_mode)); - filelist_value_->Append(file_value); - std::string val; - file_value->GetString(kPropertyTitle, &val); - if (val == originalpath_.BaseName().value()) { - currentOffset_ = counter_; - } - counter_++; -#endif -} - -void SlideshowHandler::OnListDone(int error) { - DictionaryValue info_value; - counter_ = 0; - if (!(file_util::EnsureEndsWithSeparator(&originalpath_) && - originalpath_.IsAbsolute()) && - currentOffset_ != -1) { - info_value.SetInteger(kPropertyOffset, currentOffset_); - } - if (is_refresh_) { - info_value.SetString("functionCall", "refresh"); - } else { - info_value.SetString("functionCall", "getChildren"); - } - info_value.SetString(kPropertyPath, currentpath_.value()); - web_ui_->CallJavascriptFunction("browseFileResult", - info_value, *(filelist_value_.get())); -} - -//////////////////////////////////////////////////////////////////////////////// -// -// SlideshowUI -// -//////////////////////////////////////////////////////////////////////////////// - -SlideshowUI::SlideshowUI(TabContents* contents) : WebUI(contents) { - SlideshowHandler* handler = new SlideshowHandler(); - AddMessageHandler((handler)->Attach(this)); - handler->Init(); - SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); - - // Set up the chrome://slideshow/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); -} diff --git a/chrome/browser/ui/webui/slideshow_ui.h b/chrome/browser/ui/webui/slideshow_ui.h deleted file mode 100644 index fd7413a..0000000 --- a/chrome/browser/ui/webui/slideshow_ui.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_SLIDESHOW_UI_H_ -#define CHROME_BROWSER_UI_WEBUI_SLIDESHOW_UI_H_ -#pragma once - -#include "content/browser/webui/web_ui.h" - -class SlideshowUI : public WebUI { - public: - explicit SlideshowUI(TabContents* contents); - - private: - DISALLOW_COPY_AND_ASSIGN(SlideshowUI); -}; - -#endif // CHROME_BROWSER_UI_WEBUI_SLIDESHOW_UI_H_ diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index d1db9b7..6785edc 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3354,8 +3354,6 @@ 'browser/ui/webui/shared_resources_data_source.h', 'browser/ui/webui/shown_sections_handler.cc', 'browser/ui/webui/shown_sections_handler.h', - 'browser/ui/webui/slideshow_ui.cc', - 'browser/ui/webui/slideshow_ui.h', 'browser/ui/webui/sync_internals_html_source.cc', 'browser/ui/webui/sync_internals_html_source.h', 'browser/ui/webui/sync_internals_ui.cc', @@ -3466,7 +3464,6 @@ ['exclude', 'browser/ui/webui/cookies_tree_model_adapter.cc'], ['exclude', 'browser/ui/webui/cookies_tree_model_adapter.h'], ['exclude', 'browser/ui/webui/mediaplayer_ui.cc'], - ['exclude', 'browser/ui/webui/slideshow_ui.cc'], ['exclude', 'browser/extensions/extension_file_browser_private_api.cc'], ['exclude', 'browser/extensions/extension_file_browser_private_api.h'], ], |