| OLD | NEW |
| 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/ntp/ntp_login_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/ntp_login_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 bool success = args->GetDouble(0, &x); | 151 bool success = args->GetDouble(0, &x); |
| 152 DCHECK(success); | 152 DCHECK(success); |
| 153 success = args->GetDouble(1, &y); | 153 success = args->GetDouble(1, &y); |
| 154 DCHECK(success); | 154 DCHECK(success); |
| 155 success = args->GetDouble(2, &width); | 155 success = args->GetDouble(2, &width); |
| 156 DCHECK(success); | 156 DCHECK(success); |
| 157 success = args->GetDouble(3, &height); | 157 success = args->GetDouble(3, &height); |
| 158 DCHECK(success); | 158 DCHECK(success); |
| 159 | 159 |
| 160 double zoom = content::ZoomLevelToZoomFactor( | 160 double zoom = content::ZoomLevelToZoomFactor( |
| 161 content::HostZoomMap::GetZoomLevel(web_contents)); | 161 ZoomController::FromWebContents(web_contents)->GetZoomLevel()); |
| 162 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); | 162 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); |
| 163 | 163 |
| 164 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); | 164 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); |
| 165 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); | 165 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 void NTPLoginHandler::RecordInHistogram(int type) { | 169 void NTPLoginHandler::RecordInHistogram(int type) { |
| 170 // Invalid type to record. | 170 // Invalid type to record. |
| 171 if (type < NTP_SIGN_IN_PROMO_VIEWED || | 171 if (type < NTP_SIGN_IN_PROMO_VIEWED || |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 values->SetString("login_status_message", message); | 275 values->SetString("login_status_message", message); |
| 276 values->SetString("login_status_url", | 276 values->SetString("login_status_url", |
| 277 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); | 277 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); |
| 278 values->SetString("login_status_advanced", | 278 values->SetString("login_status_advanced", |
| 279 hide_sync ? base::string16() : | 279 hide_sync ? base::string16() : |
| 280 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); | 280 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
| 281 values->SetString("login_status_dismiss", | 281 values->SetString("login_status_dismiss", |
| 282 hide_sync ? base::string16() : | 282 hide_sync ? base::string16() : |
| 283 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); | 283 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); |
| 284 } | 284 } |
| OLD | NEW |