| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 class AboutSource : public ChromeURLDataManager::DataSource { | 63 class AboutSource : public ChromeURLDataManager::DataSource { |
| 64 public: | 64 public: |
| 65 // Creates our datasource. | 65 // Creates our datasource. |
| 66 AboutSource(); | 66 AboutSource(); |
| 67 virtual ~AboutSource(); | 67 virtual ~AboutSource(); |
| 68 | 68 |
| 69 // Called when the network layer has requested a resource underneath | 69 // Called when the network layer has requested a resource underneath |
| 70 // the path we registered. | 70 // the path we registered. |
| 71 virtual void StartDataRequest(const std::string& path, int request_id); | 71 virtual void StartDataRequest(const std::string& path, int request_id); |
| 72 | 72 |
| 73 virtual std::string GetMimeType(const std::string&) const { |
| 74 return "text/html"; |
| 75 } |
| 76 |
| 73 // Send the response data. | 77 // Send the response data. |
| 74 void FinishDataRequest(const std::string& html, int request_id); | 78 void FinishDataRequest(const std::string& html, int request_id); |
| 75 | 79 |
| 76 private: | 80 private: |
| 77 DISALLOW_EVIL_CONSTRUCTORS(AboutSource); | 81 DISALLOW_EVIL_CONSTRUCTORS(AboutSource); |
| 78 }; | 82 }; |
| 79 | 83 |
| 80 // Handling about:memory is complicated enough to encapsulate it's | 84 // Handling about:memory is complicated enough to encapsulate it's |
| 81 // related methods into a single class. | 85 // related methods into a single class. |
| 82 class AboutMemoryHandler : public MemoryDetails { | 86 class AboutMemoryHandler : public MemoryDetails { |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 AboutSource* about_source = static_cast<AboutSource*>(source_); | 659 AboutSource* about_source = static_cast<AboutSource*>(source_); |
| 656 about_source->FinishDataRequest(template_html, request_id_); | 660 about_source->FinishDataRequest(template_html, request_id_); |
| 657 } | 661 } |
| 658 | 662 |
| 659 // static | 663 // static |
| 660 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) { | 664 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) { |
| 661 // The AboutMemoryHandler cleans itself up. | 665 // The AboutMemoryHandler cleans itself up. |
| 662 new AboutMemoryHandler(source, request_id); | 666 new AboutMemoryHandler(source, request_id); |
| 663 } | 667 } |
| 664 | 668 |
| OLD | NEW |