| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/slideshow_ui.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | |
| 8 #include "base/callback.h" | 7 #include "base/callback.h" |
| 9 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 11 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| 12 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
| 13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 14 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
| 15 #include "base/time.h" | 14 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 17 #include "base/values.h" | 16 #include "base/values.h" |
| 18 #include "base/weak_ptr.h" | 17 #include "base/weak_ptr.h" |
| 19 #include "chrome/browser/browser_thread.h" | 18 #include "chrome/browser/browser_thread.h" |
| 20 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" | 19 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h" |
| 21 #include "chrome/browser/history/history_types.h" | 20 #include "chrome/browser/history/history_types.h" |
| 22 #include "chrome/browser/metrics/user_metrics.h" | 21 #include "chrome/browser/metrics/user_metrics.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/tab_contents/tab_contents.h" | 23 #include "chrome/browser/tab_contents/tab_contents.h" |
| 25 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/jstemplate_builder.h" | 25 #include "chrome/common/jstemplate_builder.h" |
| 27 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 28 #include "net/base/escape.h" | |
| 29 #include "net/base/directory_lister.h" | |
| 30 | |
| 31 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 32 #include "grit/chromium_strings.h" | 28 #include "grit/chromium_strings.h" |
| 33 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 34 #include "grit/locale_settings.h" | 30 #include "grit/locale_settings.h" |
| 31 #include "net/base/escape.h" |
| 32 #include "net/base/directory_lister.h" |
| 33 #include "ui/base/resource/resource_bundle.h" |
| 35 | 34 |
| 36 static const char kPropertyPath[] = "path"; | 35 static const char kPropertyPath[] = "path"; |
| 37 static const char kPropertyTitle[] = "title"; | 36 static const char kPropertyTitle[] = "title"; |
| 38 static const char kPropertyOffset[] = "currentOffset"; | 37 static const char kPropertyOffset[] = "currentOffset"; |
| 39 static const char kPropertyDirectory[] = "isDirectory"; | 38 static const char kPropertyDirectory[] = "isDirectory"; |
| 40 | 39 |
| 41 class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource { | 40 class SlideshowUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 42 public: | 41 public: |
| 43 SlideshowUIHTMLSource(); | 42 SlideshowUIHTMLSource(); |
| 44 | 43 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); | 284 SlideshowUIHTMLSource* html_source = new SlideshowUIHTMLSource(); |
| 286 | 285 |
| 287 // Set up the chrome://slideshow/ source. | 286 // Set up the chrome://slideshow/ source. |
| 288 BrowserThread::PostTask( | 287 BrowserThread::PostTask( |
| 289 BrowserThread::IO, FROM_HERE, | 288 BrowserThread::IO, FROM_HERE, |
| 290 NewRunnableMethod( | 289 NewRunnableMethod( |
| 291 ChromeURLDataManager::GetInstance(), | 290 ChromeURLDataManager::GetInstance(), |
| 292 &ChromeURLDataManager::AddDataSource, | 291 &ChromeURLDataManager::AddDataSource, |
| 293 make_scoped_refptr(html_source))); | 292 make_scoped_refptr(html_source))); |
| 294 } | 293 } |
| OLD | NEW |