| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/chromeos/drive_internals_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 760 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 761 | 761 |
| 762 // Convert |cache_entry| into a dictionary. | 762 // Convert |cache_entry| into a dictionary. |
| 763 base::DictionaryValue value; | 763 base::DictionaryValue value; |
| 764 value.SetString("resource_id", resource_id); | 764 value.SetString("resource_id", resource_id); |
| 765 value.SetString("md5", cache_entry.md5()); | 765 value.SetString("md5", cache_entry.md5()); |
| 766 value.SetBoolean("is_present", cache_entry.is_present()); | 766 value.SetBoolean("is_present", cache_entry.is_present()); |
| 767 value.SetBoolean("is_pinned", cache_entry.is_pinned()); | 767 value.SetBoolean("is_pinned", cache_entry.is_pinned()); |
| 768 value.SetBoolean("is_dirty", cache_entry.is_dirty()); | 768 value.SetBoolean("is_dirty", cache_entry.is_dirty()); |
| 769 value.SetBoolean("is_mounted", cache_entry.is_mounted()); | 769 value.SetBoolean("is_mounted", cache_entry.is_mounted()); |
| 770 value.SetBoolean("is_persistent", cache_entry.is_persistent()); | |
| 771 | 770 |
| 772 web_ui()->CallJavascriptFunction("updateCacheContents", value); | 771 web_ui()->CallJavascriptFunction("updateCacheContents", value); |
| 773 } | 772 } |
| 774 | 773 |
| 775 void DriveInternalsWebUIHandler::OnGetFreeDiskSpace( | 774 void DriveInternalsWebUIHandler::OnGetFreeDiskSpace( |
| 776 base::DictionaryValue* local_storage_summary) { | 775 base::DictionaryValue* local_storage_summary) { |
| 777 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 776 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 778 DCHECK(local_storage_summary); | 777 DCHECK(local_storage_summary); |
| 779 | 778 |
| 780 web_ui()->CallJavascriptFunction( | 779 web_ui()->CallJavascriptFunction( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 804 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 803 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
| 805 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 804 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 806 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 805 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 807 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 806 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
| 808 | 807 |
| 809 Profile* profile = Profile::FromWebUI(web_ui); | 808 Profile* profile = Profile::FromWebUI(web_ui); |
| 810 content::WebUIDataSource::Add(profile, source); | 809 content::WebUIDataSource::Add(profile, source); |
| 811 } | 810 } |
| 812 | 811 |
| 813 } // namespace chromeos | 812 } // namespace chromeos |
| OLD | NEW |