Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 27169: Linux: add splash screen (Closed)
Patch Set: ... Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browser_about_handler.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_version_info.h" 10 #include "base/file_version_info.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 static const char kCachePath[] = "cache"; 53 static const char kCachePath[] = "cache";
54 static const char kDnsPath[] = "dns"; 54 static const char kDnsPath[] = "dns";
55 static const char kHistogramsPath[] = "histograms"; 55 static const char kHistogramsPath[] = "histograms";
56 static const char kObjectsPath[] = "objects"; 56 static const char kObjectsPath[] = "objects";
57 static const char kMemoryPath[] = "memory"; 57 static const char kMemoryPath[] = "memory";
58 static const char kPluginsPath[] = "plugins"; 58 static const char kPluginsPath[] = "plugins";
59 static const char kStatsPath[] = "stats"; 59 static const char kStatsPath[] = "stats";
60 static const char kVersionPath[] = "version"; 60 static const char kVersionPath[] = "version";
61 static const char kCreditsPath[] = "credits"; 61 static const char kCreditsPath[] = "credits";
62 static const char kTermsPath[] = "terms"; 62 static const char kTermsPath[] = "terms";
63 static const char kLinuxSplash[] = "linux-splash";
63 64
64 class AboutSource : public ChromeURLDataManager::DataSource { 65 class AboutSource : public ChromeURLDataManager::DataSource {
65 public: 66 public:
66 // Creates our datasource. 67 // Creates our datasource.
67 AboutSource(); 68 AboutSource();
68 virtual ~AboutSource(); 69 virtual ~AboutSource();
69 70
70 // Called when the network layer has requested a resource underneath 71 // Called when the network layer has requested a resource underneath
71 // the path we registered. 72 // the path we registered.
72 virtual void StartDataRequest(const std::string& path, int request_id); 73 virtual void StartDataRequest(const std::string& path, int request_id);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 response = BrowserAboutHandler::AboutPlugins(); 134 response = BrowserAboutHandler::AboutPlugins();
134 } else if (path == kStatsPath) { 135 } else if (path == kStatsPath) {
135 response = BrowserAboutHandler::AboutStats(); 136 response = BrowserAboutHandler::AboutStats();
136 } else if (path == kVersionPath || path.empty()) { 137 } else if (path == kVersionPath || path.empty()) {
137 response = BrowserAboutHandler::AboutVersion(); 138 response = BrowserAboutHandler::AboutVersion();
138 } else if (path == kCreditsPath) { 139 } else if (path == kCreditsPath) {
139 response = BrowserAboutHandler::AboutCredits(); 140 response = BrowserAboutHandler::AboutCredits();
140 } else if (path == kTermsPath) { 141 } else if (path == kTermsPath) {
141 response = BrowserAboutHandler::AboutTerms(); 142 response = BrowserAboutHandler::AboutTerms();
142 } 143 }
144 #if defined(OS_LINUX)
145 else if (path == kLinuxSplash) {
146 response = BrowserAboutHandler::AboutLinuxSplash();
147 }
148 #endif
149
143 FinishDataRequest(response, request_id); 150 FinishDataRequest(response, request_id);
144 } 151 }
145 152
146 void AboutSource::FinishDataRequest(const std::string& response, 153 void AboutSource::FinishDataRequest(const std::string& response,
147 int request_id) { 154 int request_id) {
148 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); 155 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes);
149 html_bytes->data.resize(response.size()); 156 html_bytes->data.resize(response.size());
150 std::copy(response.begin(), response.end(), html_bytes->data.begin()); 157 std::copy(response.begin(), response.end(), html_bytes->data.begin());
151 SendResponse(request_id, html_bytes); 158 SendResponse(request_id, html_bytes);
152 } 159 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // static 303 // static
297 std::string BrowserAboutHandler::AboutCredits() { 304 std::string BrowserAboutHandler::AboutCredits() {
298 static const std::string credits_html = 305 static const std::string credits_html =
299 ResourceBundle::GetSharedInstance().GetDataResource( 306 ResourceBundle::GetSharedInstance().GetDataResource(
300 IDR_CREDITS_HTML); 307 IDR_CREDITS_HTML);
301 308
302 return credits_html; 309 return credits_html;
303 } 310 }
304 311
305 // static 312 // static
313 std::string BrowserAboutHandler::AboutLinuxSplash() {
314 static const std::string linux_splash_html =
315 ResourceBundle::GetSharedInstance().GetDataResource(
316 IDR_LINUX_SPLASH_HTML);
317
318 return linux_splash_html;
319 }
320
321 // static
306 std::string BrowserAboutHandler::AboutTerms() { 322 std::string BrowserAboutHandler::AboutTerms() {
307 static const std::string terms_html = 323 static const std::string terms_html =
308 ResourceBundle::GetSharedInstance().GetDataResource( 324 ResourceBundle::GetSharedInstance().GetDataResource(
309 IDR_TERMS_HTML); 325 IDR_TERMS_HTML);
310 326
311 return terms_html; 327 return terms_html;
312 } 328 }
313 329
314 // static 330 // static
315 std::string BrowserAboutHandler::AboutPlugins() { 331 std::string BrowserAboutHandler::AboutPlugins() {
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 630
615 AboutSource* about_source = static_cast<AboutSource*>(source_); 631 AboutSource* about_source = static_cast<AboutSource*>(source_);
616 about_source->FinishDataRequest(template_html, request_id_); 632 about_source->FinishDataRequest(template_html, request_id_);
617 } 633 }
618 634
619 // static 635 // static
620 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) { 636 void BrowserAboutHandler::AboutMemory(AboutSource* source, int request_id) {
621 // The AboutMemoryHandler cleans itself up. 637 // The AboutMemoryHandler cleans itself up.
622 new AboutMemoryHandler(source, request_id); 638 new AboutMemoryHandler(source, request_id);
623 } 639 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_about_handler.h ('k') | chrome/browser/browser_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698