| 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/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 // Class to handle messages from chrome://drive-internals. | 205 // Class to handle messages from chrome://drive-internals. |
| 206 class DriveInternalsWebUIHandler : public content::WebUIMessageHandler { | 206 class DriveInternalsWebUIHandler : public content::WebUIMessageHandler { |
| 207 public: | 207 public: |
| 208 DriveInternalsWebUIHandler() | 208 DriveInternalsWebUIHandler() |
| 209 : last_sent_event_id_(-1), | 209 : last_sent_event_id_(-1), |
| 210 weak_ptr_factory_(this) { | 210 weak_ptr_factory_(this) { |
| 211 } | 211 } |
| 212 | 212 |
| 213 virtual ~DriveInternalsWebUIHandler() { | 213 ~DriveInternalsWebUIHandler() override {} |
| 214 } | |
| 215 | 214 |
| 216 private: | 215 private: |
| 217 // WebUIMessageHandler override. | 216 // WebUIMessageHandler override. |
| 218 virtual void RegisterMessages() override; | 217 void RegisterMessages() override; |
| 219 | 218 |
| 220 // Returns a DriveIntegrationService. | 219 // Returns a DriveIntegrationService. |
| 221 drive::DriveIntegrationService* GetIntegrationService(); | 220 drive::DriveIntegrationService* GetIntegrationService(); |
| 222 | 221 |
| 223 // Returns a DriveService instance. | 222 // Returns a DriveService instance. |
| 224 drive::DriveServiceInterface* GetDriveService(); | 223 drive::DriveServiceInterface* GetDriveService(); |
| 225 | 224 |
| 226 // Returns a DebugInfoCollector instance. | 225 // Returns a DebugInfoCollector instance. |
| 227 drive::DebugInfoCollector* GetDebugInfoCollector(); | 226 drive::DebugInfoCollector* GetDebugInfoCollector(); |
| 228 | 227 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); | 893 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); |
| 895 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); | 894 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); |
| 896 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); | 895 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); |
| 897 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); | 896 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); |
| 898 | 897 |
| 899 Profile* profile = Profile::FromWebUI(web_ui); | 898 Profile* profile = Profile::FromWebUI(web_ui); |
| 900 content::WebUIDataSource::Add(profile, source); | 899 content::WebUIDataSource::Add(profile, source); |
| 901 } | 900 } |
| 902 | 901 |
| 903 } // namespace chromeos | 902 } // namespace chromeos |
| OLD | NEW |