| 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/dom_ui/dom_ui_contents.h" | 5 #include "chrome/browser/dom_ui/dom_ui_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/dom_ui/dom_ui.h" | 7 #include "chrome/browser/dom_ui/dom_ui.h" |
| 8 #include "chrome/browser/dom_ui/history_ui.h" | 8 #include "chrome/browser/dom_ui/history_ui.h" |
| 9 #include "chrome/browser/dom_ui/downloads_ui.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/tab_contents/navigation_entry.h" | 11 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 11 #include "chrome/common/resource_bundle.h" | 12 #include "chrome/common/resource_bundle.h" |
| 12 | 13 |
| 13 // The scheme used for DOMUIContentses | 14 // The scheme used for DOMUIContentses |
| 14 // TODO(glen): Merge this with the scheme in chrome_url_data_manager | 15 // TODO(glen): Merge this with the scheme in chrome_url_data_manager |
| 15 static const char kURLScheme[] = "chrome-ui"; | 16 static const char kURLScheme[] = "chrome-ui"; |
| 16 | 17 |
| 17 // The path used in internal URLs to thumbnail data. | 18 // The path used in internal URLs to thumbnail data. |
| 18 static const char kThumbnailPath[] = "thumb"; | 19 static const char kThumbnailPath[] = "thumb"; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 else | 186 else |
| 186 return false; | 187 return false; |
| 187 | 188 |
| 188 // Let WebContents do whatever it's meant to do. | 189 // Let WebContents do whatever it's meant to do. |
| 189 return WebContents::NavigateToPendingEntry(reload); | 190 return WebContents::NavigateToPendingEntry(reload); |
| 190 } | 191 } |
| 191 | 192 |
| 192 DOMUI* DOMUIContents::GetDOMUIForURL(const GURL &url) { | 193 DOMUI* DOMUIContents::GetDOMUIForURL(const GURL &url) { |
| 193 if (url.host() == HistoryUI::GetBaseURL().host()) | 194 if (url.host() == HistoryUI::GetBaseURL().host()) |
| 194 return new HistoryUI(this); | 195 return new HistoryUI(this); |
| 195 | 196 else if (url.host() == DownloadsUI::GetBaseURL().host()) |
| 197 return new DownloadsUI(this); |
| 198 |
| 196 return NULL; | 199 return NULL; |
| 197 } | 200 } |
| 198 | 201 |
| 199 void DOMUIContents::ProcessDOMUIMessage(const std::string& message, | 202 void DOMUIContents::ProcessDOMUIMessage(const std::string& message, |
| 200 const std::string& content) { | 203 const std::string& content) { |
| 201 DCHECK(current_ui_); | 204 DCHECK(current_ui_); |
| 202 current_ui_->ProcessDOMUIMessage(message, content); | 205 current_ui_->ProcessDOMUIMessage(message, content); |
| 203 } | 206 } |
| 204 | 207 |
| 205 // static | 208 // static |
| 206 const std::string DOMUIContents::GetScheme() { | 209 const std::string DOMUIContents::GetScheme() { |
| 207 return kURLScheme; | 210 return kURLScheme; |
| 208 } | 211 } |
| 209 | 212 |
| OLD | NEW |