| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/customization_document.h" | 5 #include "chrome/browser/chromeos/customization_document.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 root->GetString(kInitialLocaleAttr, &initial_locale_); | 96 root->GetString(kInitialLocaleAttr, &initial_locale_); |
| 97 | 97 |
| 98 initial_timezone_.clear(); | 98 initial_timezone_.clear(); |
| 99 root->GetString(kInitialTimezoneAttr, &initial_timezone_); | 99 root->GetString(kInitialTimezoneAttr, &initial_timezone_); |
| 100 | 100 |
| 101 std::string background_color_string; | 101 std::string background_color_string; |
| 102 root->GetString(kBackgroundColorAttr, &background_color_string); | 102 root->GetString(kBackgroundColorAttr, &background_color_string); |
| 103 if (!background_color_string.empty()) { | 103 if (!background_color_string.empty()) { |
| 104 if (background_color_string[0] == '#') { | 104 if (background_color_string[0] == '#') { |
| 105 int background_int; | 105 int background_int; |
| 106 base::HexStringToInt(background_color_string.substr(1), &background_int); | 106 base::HexStringToInt(background_color_string.begin() + 1, |
| 107 background_color_string.end(), |
| 108 &background_int); |
| 107 background_color_ = static_cast<SkColor>(0xff000000 | background_int); | 109 background_color_ = static_cast<SkColor>(0xff000000 | background_int); |
| 108 } else { | 110 } else { |
| 109 // Literal color constants are not supported yet. | 111 // Literal color constants are not supported yet. |
| 110 return false; | 112 return false; |
| 111 } | 113 } |
| 112 } | 114 } |
| 113 | 115 |
| 114 registration_url_.clear(); | 116 registration_url_.clear(); |
| 115 root->GetString(kRegistrationUrlAttr, ®istration_url_); | 117 root->GetString(kRegistrationUrlAttr, ®istration_url_); |
| 116 | 118 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 iter != list_value->end(); | 200 iter != list_value->end(); |
| 199 ++iter) { | 201 ++iter) { |
| 200 std::string url; | 202 std::string url; |
| 201 if ((*iter)->GetAsString(&url)) | 203 if ((*iter)->GetAsString(&url)) |
| 202 string_list->push_back(url); | 204 string_list->push_back(url); |
| 203 } | 205 } |
| 204 return true; | 206 return true; |
| 205 } | 207 } |
| 206 | 208 |
| 207 } // namespace chromeos | 209 } // namespace chromeos |
| OLD | NEW |