| 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 #ifndef CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ | 6 #define CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | 12 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 13 #include "chrome/browser/dom_ui/dom_ui.h" | 13 #include "chrome/browser/dom_ui/dom_ui.h" |
| 14 #include "chrome/browser/cancelable_request.h" | 14 #include "chrome/browser/cancelable_request.h" |
| 15 #include "chrome/browser/history/history.h" | 15 #include "chrome/browser/history/history.h" |
| 16 #include "chrome/common/notification_registrar.h" | 16 #include "chrome/common/notification_registrar.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource { | 20 class HistoryUIHTMLSource : public ChromeURLDataManager::DataSource { |
| 21 public: | 21 public: |
| 22 HistoryUIHTMLSource(); | 22 HistoryUIHTMLSource(); |
| 23 | 23 |
| 24 // Called when the network layer has requested a resource underneath | 24 // Called when the network layer has requested a resource underneath |
| 25 // the path we registered. | 25 // the path we registered. |
| 26 virtual void StartDataRequest(const std::string& path, | 26 virtual void StartDataRequest(const std::string& path, |
| 27 bool is_off_the_record, | 27 bool is_off_the_record, |
| 28 int request_id); | 28 int request_id); |
| 29 virtual std::string GetMimeType(const std::string&) const { | 29 virtual std::string GetMimeType(const std::string&) const; |
| 30 return "text/html"; | |
| 31 } | |
| 32 | 30 |
| 33 private: | 31 private: |
| 34 ~HistoryUIHTMLSource() {} | 32 ~HistoryUIHTMLSource() {} |
| 35 | 33 |
| 36 DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource); | 34 DISALLOW_COPY_AND_ASSIGN(HistoryUIHTMLSource); |
| 37 }; | 35 }; |
| 38 | 36 |
| 39 // The handler for Javascript messages related to the "history" view. | 37 // The handler for Javascript messages related to the "history" view. |
| 40 class BrowsingHistoryHandler : public DOMMessageHandler, | 38 class BrowsingHistoryHandler : public DOMMessageHandler, |
| 41 public NotificationObserver { | 39 public NotificationObserver { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Return the URL for a given search term. | 99 // Return the URL for a given search term. |
| 102 static const GURL GetHistoryURLWithSearchText(const string16& text); | 100 static const GURL GetHistoryURLWithSearchText(const string16& text); |
| 103 | 101 |
| 104 static RefCountedMemory* GetFaviconResourceBytes(); | 102 static RefCountedMemory* GetFaviconResourceBytes(); |
| 105 | 103 |
| 106 private: | 104 private: |
| 107 DISALLOW_COPY_AND_ASSIGN(HistoryUI); | 105 DISALLOW_COPY_AND_ASSIGN(HistoryUI); |
| 108 }; | 106 }; |
| 109 | 107 |
| 110 #endif // CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ | 108 #endif // CHROME_BROWSER_DOM_UI_HISTORY_UI_H_ |
| OLD | NEW |