Chromium Code Reviews| Index: chrome/browser/profiles/profile.cc |
| =================================================================== |
| --- chrome/browser/profiles/profile.cc (revision 89645) |
| +++ chrome/browser/profiles/profile.cc (working copy) |
| @@ -23,6 +23,8 @@ |
| #include "chrome/browser/extensions/extension_process_manager.h" |
| #include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| +#include "chrome/browser/io_thread.h" |
| +#include "chrome/browser/net/predictor_api.h" |
| #include "chrome/browser/net/pref_proxy_config_service.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
| @@ -208,6 +210,43 @@ |
| //////////////////////////////////////////////////////////////////////////////// |
| // |
| +// This section supports the about:dns page. |
| +// |
| +//////////////////////////////////////////////////////////////////////////////// |
| + |
| +// Provide global support for the about:dns page. |
| +void Profile::PredictorGetHtmlInfo(std::string* output) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| + |
| + output->append("<html><head><title>About DNS</title>" |
| + // We'd like the following no-cache... but it doesn't work. |
| + // "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">" |
| + "</head><body>"); |
| + chrome_browser_net::Predictor* predictor = GetPredictor(); |
| + if (predictor && predictor->predictor_enabled()) { |
|
Miranda Callahan
2011/07/21 14:38:04
Isn't there be a race condition here if you allow
rpetterson
2011/08/10 02:24:46
I've fixed EnablePredictor to post a task to enabl
|
| + output->append("DNS pre-resolution and TCP pre-connection is disabled."); |
| + } else { |
| + if (!predictor->on_the_record()) { |
| + output->append("Incognito mode is active in a window."); |
| + } else { |
| + // Show list of prediction results. |
| + predictor->GetHtmlInfo(output); |
| + } |
| + } |
| + output->append("</body></html>"); |
| +} |
| + |
| +void Profile::PredictorOnTheRecord(bool enable) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + if (GetPredictor()->on_the_record() == enable) |
| + return; |
| + GetPredictor()->SetOnTheRecord(enable); |
| + if (GetPredictor()->on_the_record()) |
| + g_browser_process->io_thread()->ChangedToOnTheRecord(this); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// |
| // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile |
| // to make it suitable for the incognito mode. |
| // |