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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 bool success = args->GetDouble(0, &x); | 147 bool success = args->GetDouble(0, &x); |
148 DCHECK(success); | 148 DCHECK(success); |
149 success = args->GetDouble(1, &y); | 149 success = args->GetDouble(1, &y); |
150 DCHECK(success); | 150 DCHECK(success); |
151 success = args->GetDouble(2, &width); | 151 success = args->GetDouble(2, &width); |
152 DCHECK(success); | 152 DCHECK(success); |
153 success = args->GetDouble(3, &height); | 153 success = args->GetDouble(3, &height); |
154 DCHECK(success); | 154 DCHECK(success); |
155 | 155 |
156 double zoom = content::ZoomLevelToZoomFactor( | 156 double zoom = content::ZoomLevelToZoomFactor( |
157 ZoomController::FromWebContents(web_contents)->GetZoomLevel()); | 157 ui_zoom::ZoomController::FromWebContents(web_contents)->GetZoomLevel()); |
158 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); | 158 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); |
159 | 159 |
160 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); | 160 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); |
161 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); | 161 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 void NTPLoginHandler::RecordInHistogram(int type) { | 165 void NTPLoginHandler::RecordInHistogram(int type) { |
166 // Invalid type to record. | 166 // Invalid type to record. |
167 if (type < NTP_SIGN_IN_PROMO_VIEWED || | 167 if (type < NTP_SIGN_IN_PROMO_VIEWED || |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 values->SetString("login_status_message", message); | 271 values->SetString("login_status_message", message); |
272 values->SetString("login_status_url", | 272 values->SetString("login_status_url", |
273 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); | 273 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); |
274 values->SetString("login_status_advanced", | 274 values->SetString("login_status_advanced", |
275 hide_sync ? base::string16() : | 275 hide_sync ? base::string16() : |
276 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); | 276 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
277 values->SetString("login_status_dismiss", | 277 values->SetString("login_status_dismiss", |
278 hide_sync ? base::string16() : | 278 hide_sync ? base::string16() : |
279 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); | 279 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); |
280 } | 280 } |
OLD | NEW |