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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/about_page_handler.cc

Issue 9320056: Help: Implement the initial version of the cross-platform help/about page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: String fix. Created 8 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 | Annotate | Revision Log
OLDNEW
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/options/chromeos/about_page_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/about_page_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 #if !defined(GOOGLE_CHROME_BUILD) 166 #if !defined(GOOGLE_CHROME_BUILD)
167 browser_version += " ("; 167 browser_version += " (";
168 browser_version += version_info.LastChange(); 168 browser_version += version_info.LastChange();
169 browser_version += ")"; 169 browser_version += ")";
170 #endif 170 #endif
171 171
172 localized_strings->SetString("browser_version", browser_version); 172 localized_strings->SetString("browser_version", browser_version);
173 173
174 // license 174 // license
175 175
176 std::string text = l10n_util::GetStringUTF8(IDS_ABOUT_VERSION_LICENSE); 176 std::string text = l10n_util::GetStringUTF8(IDS_ABOUT_OLD_VERSION_LICENSE);
177 177
178 bool chromium_url_appears_first = 178 bool chromium_url_appears_first =
179 text.find(kBeginLinkChr) < text.find(kBeginLinkOss); 179 text.find(kBeginLinkChr) < text.find(kBeginLinkOss);
180 180
181 size_t link1 = text.find(kBeginLink); 181 size_t link1 = text.find(kBeginLink);
182 DCHECK(link1 != std::string::npos); 182 DCHECK(link1 != std::string::npos);
183 size_t link1_end = text.find(kEndLink, link1); 183 size_t link1_end = text.find(kEndLink, link1);
184 DCHECK(link1_end != std::string::npos); 184 DCHECK(link1_end != std::string::npos);
185 size_t link2 = text.find(kBeginLink, link1_end); 185 size_t link2 = text.find(kBeginLink, link1_end);
186 DCHECK(link2 != std::string::npos); 186 DCHECK(link2 != std::string::npos);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 339
340 void AboutPageHandler::UpdateStatus( 340 void AboutPageHandler::UpdateStatus(
341 const UpdateEngineClient::Status& status) { 341 const UpdateEngineClient::Status& status) {
342 string16 message; 342 string16 message;
343 std::string image = "up-to-date"; 343 std::string image = "up-to-date";
344 bool enabled = false; 344 bool enabled = false;
345 345
346 switch (status.status) { 346 switch (status.status) {
347 case UpdateEngineClient::UPDATE_STATUS_IDLE: 347 case UpdateEngineClient::UPDATE_STATUS_IDLE:
348 if (!sticky_) { 348 if (!sticky_) {
349 message = l10n_util::GetStringUTF16(IDS_UPGRADE_ALREADY_UP_TO_DATE); 349 message = l10n_util::GetStringUTF16(IDS_UPGRADE_UP_TO_DATE);
350 enabled = true; 350 enabled = true;
351 } 351 }
352 break; 352 break;
353 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: 353 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE:
354 message = l10n_util::GetStringUTF16(IDS_UPGRADE_CHECK_STARTED); 354 message = l10n_util::GetStringUTF16(IDS_UPGRADE_CHECK_STARTED);
355 sticky_ = false; 355 sticky_ = false;
356 break; 356 break;
357 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE: 357 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE:
358 message = l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE); 358 message = l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE);
359 started_ = true; 359 started_ = true;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // If UpdateEngineClient still has the observer, then the page handler 448 // If UpdateEngineClient still has the observer, then the page handler
449 // is valid. 449 // is valid.
450 AboutPageHandler* handler = observer->page_handler(); 450 AboutPageHandler* handler = observer->page_handler();
451 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel)); 451 scoped_ptr<Value> channel_string(Value::CreateStringValue(channel));
452 handler->web_ui()->CallJavascriptFunction( 452 handler->web_ui()->CallJavascriptFunction(
453 "AboutPage.updateSelectedOptionCallback", *channel_string); 453 "AboutPage.updateSelectedOptionCallback", *channel_string);
454 } 454 }
455 } 455 }
456 456
457 } // namespace chromeos 457 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698