| 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/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 // Timer that enforces a timeout on the attempt to download the | 169 // Timer that enforces a timeout on the attempt to download the |
| 170 // ChromeOS Terms. | 170 // ChromeOS Terms. |
| 171 base::OneShotTimer download_timer_; | 171 base::OneShotTimer download_timer_; |
| 172 | 172 |
| 173 // |fetch_callback_| called when fetching succeeded or failed. | 173 // |fetch_callback_| called when fetching succeeded or failed. |
| 174 FetchCallback fetch_callback_; | 174 FetchCallback fetch_callback_; |
| 175 | 175 |
| 176 // Helper to fetch online eula. | 176 // Helper to fetch online eula. |
| 177 scoped_ptr<net::URLFetcher> eula_fetcher_; | 177 std::unique_ptr<net::URLFetcher> eula_fetcher_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(ChromeOSOnlineTermsHandler); | 179 DISALLOW_COPY_AND_ASSIGN(ChromeOSOnlineTermsHandler); |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 class ChromeOSTermsHandler | 182 class ChromeOSTermsHandler |
| 183 : public base::RefCountedThreadSafe<ChromeOSTermsHandler> { | 183 : public base::RefCountedThreadSafe<ChromeOSTermsHandler> { |
| 184 public: | 184 public: |
| 185 static void Start(const std::string& path, | 185 static void Start(const std::string& path, |
| 186 const content::URLDataSource::GotDataCallback& callback) { | 186 const content::URLDataSource::GotDataCallback& callback) { |
| 187 scoped_refptr<ChromeOSTermsHandler> handler( | 187 scoped_refptr<ChromeOSTermsHandler> handler( |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 Profile* profile = Profile::FromWebUI(web_ui); | 838 Profile* profile = Profile::FromWebUI(web_ui); |
| 839 | 839 |
| 840 #if defined(ENABLE_THEMES) | 840 #if defined(ENABLE_THEMES) |
| 841 // Set up the chrome://theme/ source. | 841 // Set up the chrome://theme/ source. |
| 842 ThemeSource* theme = new ThemeSource(profile); | 842 ThemeSource* theme = new ThemeSource(profile); |
| 843 content::URLDataSource::Add(profile, theme); | 843 content::URLDataSource::Add(profile, theme); |
| 844 #endif | 844 #endif |
| 845 | 845 |
| 846 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 846 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 847 } | 847 } |
| OLD | NEW |