OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/web_resource/web_resource_service.h" | 5 #include "chrome/browser/web_resource/web_resource_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 old_promo_end = prefs_->GetReal(prefs::kNTPPromoEnd); | 392 old_promo_end = prefs_->GetReal(prefs::kNTPPromoEnd); |
393 } | 393 } |
394 | 394 |
395 // Check for newly received start and end values. | 395 // Check for newly received start and end values. |
396 if (parsed_json.GetDictionary("topic", &topic_dict)) { | 396 if (parsed_json.GetDictionary("topic", &topic_dict)) { |
397 if (topic_dict->GetList("answers", &answer_list)) { | 397 if (topic_dict->GetList("answers", &answer_list)) { |
398 std::string promo_start_string = ""; | 398 std::string promo_start_string = ""; |
399 std::string promo_end_string = ""; | 399 std::string promo_end_string = ""; |
400 std::string promo_string = ""; | 400 std::string promo_string = ""; |
401 std::string promo_build = ""; | 401 std::string promo_build = ""; |
402 int promo_build_type; | 402 int promo_build_type = 0; |
403 int time_slice_hrs; | 403 int time_slice_hrs = 0; |
404 for (ListValue::const_iterator tip_iter = answer_list->begin(); | 404 for (ListValue::const_iterator tip_iter = answer_list->begin(); |
405 tip_iter != answer_list->end(); ++tip_iter) { | 405 tip_iter != answer_list->end(); ++tip_iter) { |
406 if (!(*tip_iter)->IsType(Value::TYPE_DICTIONARY)) | 406 if (!(*tip_iter)->IsType(Value::TYPE_DICTIONARY)) |
407 continue; | 407 continue; |
408 DictionaryValue* a_dic = | 408 DictionaryValue* a_dic = |
409 static_cast<DictionaryValue*>(*tip_iter); | 409 static_cast<DictionaryValue*>(*tip_iter); |
410 std::string promo_signal; | 410 std::string promo_signal; |
411 if (a_dic->GetString("name", &promo_signal)) { | 411 if (a_dic->GetString("name", &promo_signal)) { |
412 if (promo_signal == "promo_start") { | 412 if (promo_signal == "promo_start") { |
413 a_dic->GetString("question", &promo_build); | 413 a_dic->GetString("question", &promo_build); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 } else { | 571 } else { |
572 is_promo_build = true; | 572 is_promo_build = true; |
573 } | 573 } |
574 } | 574 } |
575 | 575 |
576 return !promo_closed && !is_synced && is_promo_build; | 576 return !promo_closed && !is_synced && is_promo_build; |
577 } | 577 } |
578 | 578 |
579 } // namespace WebResourceService | 579 } // namespace WebResourceService |
580 | 580 |
OLD | NEW |