<commit_before>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h"

#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "content/public/browser/web_ui.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"

namespace chromeos {

UpdateScreenHandler::UpdateScreenHandler()
    : screen_(NULL),
      show_on_init_(false) {
}

UpdateScreenHandler::~UpdateScreenHandler() {
  if (screen_)
    screen_->OnActorDestroyed(this);
}

void UpdateScreenHandler::GetLocalizedStrings(
    DictionaryValue *localized_strings) {
  const string16 short_product_name =
      l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
  localized_strings->SetString("checkingForUpdatesMsg",
      l10n_util::GetStringFUTF16(IDS_CHECKING_FOR_UPDATE_MSG,
                                 short_product_name));
  localized_strings->SetString("updateScreenTitle",
      l10n_util::GetStringUTF16(IDS_UPDATE_SCREEN_TITLE));
  localized_strings->SetString("checkingForUpdates",
      l10n_util::GetStringUTF16(IDS_CHECKING_FOR_UPDATES));
  localized_strings->SetString("installingUpdateDesc",
      l10n_util::GetStringFUTF16(IDS_UPDATE_MSG, short_product_name));
  localized_strings->SetString("downloading",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING));
  localized_strings->SetString("downloadingTimeLeftLong",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_LONG));
  localized_strings->SetString("downloadingTimeLeftStatusOneHour",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_STATUS_ONE_HOUR));
  localized_strings->SetString("downloadingTimeLeftStatusMinutes",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_STATUS_MINUTES));
  localized_strings->SetString("downloadingTimeLeftSmall",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_SMALL));
#if !defined(OFFICIAL_BUILD)
  localized_strings->SetString("cancelUpdateHint",
      l10n_util::GetStringUTF16(IDS_UPDATE_CANCEL));
  localized_strings->SetString("cancelledUpdateMessage",
      l10n_util::GetStringUTF16(IDS_UPDATE_CANCELLED));
#endif
}

void UpdateScreenHandler::Initialize() {
  if (show_on_init_) {
    Show();
    show_on_init_ = false;
  }
}

void UpdateScreenHandler::SetDelegate(UpdateScreenActor::Delegate* screen) {
  screen_ = screen;
}<commit_msg>Fix JS error: Could not find value for cancelUpdateHint<commit_after>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h"

#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "content/public/browser/web_ui.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"

namespace chromeos {

UpdateScreenHandler::UpdateScreenHandler()
    : screen_(NULL),
      show_on_init_(false) {
}

UpdateScreenHandler::~UpdateScreenHandler() {
  if (screen_)
    screen_->OnActorDestroyed(this);
}

void UpdateScreenHandler::GetLocalizedStrings(
    DictionaryValue *localized_strings) {
  const string16 short_product_name =
      l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME);
  localized_strings->SetString("checkingForUpdatesMsg",
      l10n_util::GetStringFUTF16(IDS_CHECKING_FOR_UPDATE_MSG,
                                 short_product_name));
  localized_strings->SetString("updateScreenTitle",
      l10n_util::GetStringUTF16(IDS_UPDATE_SCREEN_TITLE));
  localized_strings->SetString("checkingForUpdates",
      l10n_util::GetStringUTF16(IDS_CHECKING_FOR_UPDATES));
  localized_strings->SetString("installingUpdateDesc",
      l10n_util::GetStringFUTF16(IDS_UPDATE_MSG, short_product_name));
  localized_strings->SetString("downloading",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING));
  localized_strings->SetString("downloadingTimeLeftLong",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_LONG));
  localized_strings->SetString("downloadingTimeLeftStatusOneHour",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_STATUS_ONE_HOUR));
  localized_strings->SetString("downloadingTimeLeftStatusMinutes",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_STATUS_MINUTES));
  localized_strings->SetString("downloadingTimeLeftSmall",
      l10n_util::GetStringUTF16(IDS_DOWNLOADING_TIME_LEFT_SMALL));
#if !defined(OFFICIAL_BUILD)
  localized_strings->SetString("cancelUpdateHint",
      l10n_util::GetStringUTF16(IDS_UPDATE_CANCEL));
  localized_strings->SetString("cancelledUpdateMessage",
      l10n_util::GetStringUTF16(IDS_UPDATE_CANCELLED));
#else
  localized_strings->SetString("cancelUpdateHint", "");
  localized_strings->SetString("cancelledUpdateMessage", "");
#endif
}

void UpdateScreenHandler::Initialize() {
  if (show_on_init_) {
    Show();
    show_on_init_ = false;
  }
}

void UpdateScreenHandler::SetDelegate(UpdateScreenActor::Delegate* screen) {
  screen_ = screen;
}
{'fraction_non_alphanumeric': 0.10934613963797563, 'fraction_numerical': 0.021425932766900628, 'mean_word_length': 6.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7659271', 'n_tokens_mistral': 1841, 'n_tokens_neox': 1797, 'n_words': 221}