| 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/bookmarks_ui.h" | 5 #include "chrome/browser/dom_ui/bookmarks_ui.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/ref_counted_memory.h" | 9 #include "base/ref_counted_memory.h" |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 BookmarksUIHTMLSource::BookmarksUIHTMLSource() | 25 BookmarksUIHTMLSource::BookmarksUIHTMLSource() |
| 26 : DataSource(chrome::kChromeUIBookmarksHost, MessageLoop::current()) { | 26 : DataSource(chrome::kChromeUIBookmarksHost, MessageLoop::current()) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 void BookmarksUIHTMLSource::StartDataRequest(const std::string& path, | 29 void BookmarksUIHTMLSource::StartDataRequest(const std::string& path, |
| 30 bool is_off_the_record, | 30 bool is_off_the_record, |
| 31 int request_id) { | 31 int request_id) { |
| 32 NOTREACHED() << "We should never get here since the extension should have" | 32 NOTREACHED() << "We should never get here since the extension should have" |
| 33 << "been triggered"; | 33 << "been triggered"; |
| 34 |
| 35 SendResponse(request_id, NULL); |
| 34 } | 36 } |
| 35 | 37 |
| 36 std::string BookmarksUIHTMLSource::GetMimeType(const std::string& path) const { | 38 std::string BookmarksUIHTMLSource::GetMimeType(const std::string& path) const { |
| 37 NOTREACHED() << "We should never get here since the extension should have" | 39 NOTREACHED() << "We should never get here since the extension should have" |
| 38 << "been triggered"; | 40 << "been triggered"; |
| 39 return "text/html"; | 41 return "text/html"; |
| 40 } | 42 } |
| 41 | 43 |
| 42 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
| 43 // | 45 // |
| 44 // BookmarksUI | 46 // BookmarksUI |
| 45 // | 47 // |
| 46 //////////////////////////////////////////////////////////////////////////////// | 48 //////////////////////////////////////////////////////////////////////////////// |
| 47 | 49 |
| 48 BookmarksUI::BookmarksUI(TabContents* contents) : DOMUI(contents) { | 50 BookmarksUI::BookmarksUI(TabContents* contents) : DOMUI(contents) { |
| 49 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource(); | 51 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource(); |
| 50 | 52 |
| 51 // Set up the chrome://bookmarks/ source. | 53 // Set up the chrome://bookmarks/ source. |
| 52 ChromeThread::PostTask( | 54 ChromeThread::PostTask( |
| 53 ChromeThread::IO, FROM_HERE, | 55 ChromeThread::IO, FROM_HERE, |
| 54 NewRunnableMethod( | 56 NewRunnableMethod( |
| 55 Singleton<ChromeURLDataManager>::get(), | 57 Singleton<ChromeURLDataManager>::get(), |
| 56 &ChromeURLDataManager::AddDataSource, | 58 &ChromeURLDataManager::AddDataSource, |
| 57 make_scoped_refptr(html_source))); | 59 make_scoped_refptr(html_source))); |
| 58 } | 60 } |
| 59 | 61 |
| 60 // static | 62 // static |
| 61 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() { | 63 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() { |
| 62 return ResourceBundle::GetSharedInstance(). | 64 return ResourceBundle::GetSharedInstance(). |
| 63 LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON); | 65 LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON); |
| 64 } | 66 } |
| OLD | NEW |