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

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

Issue 10453101: Convert most of the rest of chrome to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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 | Annotate | Revision Log
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // Only show the profile picture and full name for the single profile 205 // Only show the profile picture and full name for the single profile
206 // case. In the multi-profile case the profile picture is visible in the 206 // case. In the multi-profile case the profile picture is visible in the
207 // title bar and the full name can be ambiguous. 207 // title bar and the full name can be ambiguous.
208 if (cache.GetNumberOfProfiles() == 1) { 208 if (cache.GetNumberOfProfiles() == 1) {
209 string16 name = cache.GetGAIANameOfProfileAtIndex(profile_index); 209 string16 name = cache.GetGAIANameOfProfileAtIndex(profile_index);
210 if (!name.empty()) 210 if (!name.empty())
211 header = CreateSpanWithClass(name, "profile-name"); 211 header = CreateSpanWithClass(name, "profile-name");
212 const gfx::Image* image = 212 const gfx::Image* image =
213 cache.GetGAIAPictureOfProfileAtIndex(profile_index); 213 cache.GetGAIAPictureOfProfileAtIndex(profile_index);
214 if (image) 214 if (image)
215 icon_url = web_ui_util::GetImageDataUrl(GetGAIAPictureForNTP(*image)); 215 icon_url = web_ui_util::GetImageDataUrl(gfx::ImageSkia(
216 GetGAIAPictureForNTP(*image)));
216 } 217 }
217 if (header.empty()) 218 if (header.empty())
218 header = CreateSpanWithClass(UTF8ToUTF16(username), "profile-name"); 219 header = CreateSpanWithClass(UTF8ToUTF16(username), "profile-name");
219 } 220 }
220 } else { 221 } else {
221 #if !defined(OS_ANDROID) 222 #if !defined(OS_ANDROID)
222 // Android uses a custom sync promo 223 // Android uses a custom sync promo
223 if (SyncPromoUI::ShouldShowSyncPromo(profile)) { 224 if (SyncPromoUI::ShouldShowSyncPromo(profile)) {
224 string16 signed_in_link = l10n_util::GetStringUTF16( 225 string16 signed_in_link = l10n_util::GetStringUTF16(
225 IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_LINK); 226 IDS_SYNC_PROMO_NOT_SIGNED_IN_STATUS_LINK);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME))); 271 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
271 values->SetString("login_status_url", 272 values->SetString("login_status_url",
272 hide_sync ? std::string() : chrome::kSyncLearnMoreURL); 273 hide_sync ? std::string() : chrome::kSyncLearnMoreURL);
273 values->SetString("login_status_advanced", 274 values->SetString("login_status_advanced",
274 hide_sync ? string16() : 275 hide_sync ? string16() :
275 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); 276 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED));
276 values->SetString("login_status_dismiss", 277 values->SetString("login_status_dismiss",
277 hide_sync ? string16() : 278 hide_sync ? string16() :
278 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK)); 279 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_OK));
279 } 280 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | chrome/browser/ui/webui/options2/browser_options_handler2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698