| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dom_ui/slideshow_ui.h" | 5 #include "chrome/browser/webui/slideshow_ui.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 11 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "base/weak_ptr.h" | 17 #include "base/weak_ptr.h" |
| 18 #include "chrome/browser/browser_thread.h" | 18 #include "chrome/browser/browser_thread.h" |
| 19 #include "chrome/browser/dom_ui/web_ui_favicon_source.h" | 19 #include "chrome/browser/dom_ui/web_ui_favicon_source.h" |
| 20 #include "chrome/browser/history/history_types.h" | 20 #include "chrome/browser/history/history_types.h" |
| 21 #include "chrome/browser/metrics/user_metrics.h" | 21 #include "chrome/browser/metrics/user_metrics.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/jstemplate_builder.h" | 25 #include "chrome/common/jstemplate_builder.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 28 #include "grit/chromium_strings.h" | 28 #include "grit/chromium_strings.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "grit/locale_settings.h" | 30 #include "grit/locale_settings.h" |
| 31 #include "net/base/directory_lister.h" |
| 31 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
| 32 #include "net/base/directory_lister.h" | |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 | 34 |
| 35 static const char kPropertyPath[] = "path"; | 35 static const char kPropertyPath[] = "path"; |
| 36 static const char kPropertyTitle[] = "title"; | 36 static const char kPropertyTitle[] = "title"; |
| 37 static const char kPropertyOffset[] = "currentOffset"; | 37 static const char kPropertyOffset[] = "currentOffset"; |
| 38 static const char kPropertyDirectory[] = "isDirectory"; | 38 static const char kPropertyDirectory[] = "isDirectory"; |
| 39 | 39 |
| 40 class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource { | 40 class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 41 public: | 41 public: |
| 42 SlideshowUIHTMLSource(); | 42 SlideshowUIHTMLSource(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 SlideshowUI::SlideshowUI(TabContents* contents) : WebUI(contents) { | 276 SlideshowUI::SlideshowUI(TabContents* contents) : WebUI(contents) { |
| 277 SlideshowHandler* handler = new SlideshowHandler(); | 277 SlideshowHandler* handler = new SlideshowHandler(); |
| 278 AddMessageHandler((handler)->Attach(this)); | 278 AddMessageHandler((handler)->Attach(this)); |
| 279 handler->Init(); | 279 handler->Init(); |
| 280 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); | 280 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); |
| 281 | 281 |
| 282 // Set up the chrome://slideshow/ source. | 282 // Set up the chrome://slideshow/ source. |
| 283 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); | 283 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); |
| 284 } | 284 } |
| OLD | NEW |