Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_login_handler.cc

Issue 769593003: Move ZoomObserver, ZoomController and ZoomEventManager to components/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ui_zoom stuff to components instead. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ZoomController::FromWebContents(web_contents)->GetZoomLevel()); 161 components::ZoomController::FromWebContents(web_contents)
162 ->GetZoomLevel());
162 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom); 163 gfx::Rect rect(x * zoom, y * zoom, width * zoom, height * zoom);
163 164
164 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect); 165 browser->window()->ShowAvatarBubble(web_ui()->GetWebContents(), rect);
165 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE); 166 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::NTP_AVATAR_BUBBLE);
166 } 167 }
167 } 168 }
168 169
169 void NTPLoginHandler::RecordInHistogram(int type) { 170 void NTPLoginHandler::RecordInHistogram(int type) {
170 // Invalid type to record. 171 // Invalid type to record.
171 if (type < NTP_SIGN_IN_PROMO_VIEWED || 172 if (type < NTP_SIGN_IN_PROMO_VIEWED ||
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 values->SetString("login_status_message", message); 276 values->SetString("login_status_message", message);
276 values->SetString("login_status_url", 277 values->SetString("login_status_url",
277 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); 278 hide_sync ? std::string() : chrome::kSyncLearnMoreURL);
278 values->SetString("login_status_advanced", 279 values->SetString("login_status_advanced",
279 hide_sync ? base::string16() : 280 hide_sync ? base::string16() :
280 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 281 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
281 values->SetString("login_status_dismiss", 282 values->SetString("login_status_dismiss",
282 hide_sync ? base::string16() : 283 hide_sync ? base::string16() :
283 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 284 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
284 } 285 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698