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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service.cc

Issue 10378009: Get rid of Image::Image(SkBitmap*) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: k Created 8 years, 7 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
« no previous file with comments | « chrome/browser/icon_loader_win.cc ('k') | chrome/browser/tab_contents/thumbnail_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/profiles/gaia_info_update_service.h" 5 #include "chrome/browser/profiles/gaia_info_update_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return; 122 return;
123 123
124 cache.SetGAIANameOfProfileAtIndex(profile_index, full_name); 124 cache.SetGAIANameOfProfileAtIndex(profile_index, full_name);
125 // The profile index may have changed. 125 // The profile index may have changed.
126 profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath()); 126 profile_index = cache.GetIndexOfProfileWithPath(profile_->GetPath());
127 if (profile_index == std::string::npos) 127 if (profile_index == std::string::npos)
128 return; 128 return;
129 if (picture_status == ProfileDownloader::PICTURE_SUCCESS) { 129 if (picture_status == ProfileDownloader::PICTURE_SUCCESS) {
130 profile_->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL, 130 profile_->GetPrefs()->SetString(prefs::kProfileGAIAInfoPictureURL,
131 picture_url); 131 picture_url);
132 gfx::Image gfx_image(new SkBitmap(bitmap)); 132 gfx::Image gfx_image(bitmap);
133 cache.SetGAIAPictureOfProfileAtIndex(profile_index, &gfx_image); 133 cache.SetGAIAPictureOfProfileAtIndex(profile_index, &gfx_image);
134 } else if (picture_status == ProfileDownloader::PICTURE_DEFAULT) { 134 } else if (picture_status == ProfileDownloader::PICTURE_DEFAULT) {
135 cache.SetGAIAPictureOfProfileAtIndex(profile_index, NULL); 135 cache.SetGAIAPictureOfProfileAtIndex(profile_index, NULL);
136 } 136 }
137 137
138 // If this profile hasn't switched to using GAIA information for the profile 138 // If this profile hasn't switched to using GAIA information for the profile
139 // name and picture then switch it now. Once the profile has switched this 139 // name and picture then switch it now. Once the profile has switched this
140 // preference guards against clobbering the user's custom settings. 140 // preference guards against clobbering the user's custom settings.
141 if (!cache.GetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index)) { 141 if (!cache.GetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index)) {
142 cache.SetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index, true); 142 cache.SetHasMigratedToGAIAInfoOfProfileAtIndex(profile_index, true);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const base::TimeDelta update_delta = base::Time::Now() - last_updated_; 198 const base::TimeDelta update_delta = base::Time::Now() - last_updated_;
199 199
200 base::TimeDelta delta; 200 base::TimeDelta delta;
201 if (update_delta < base::TimeDelta() || update_delta > desired_delta) 201 if (update_delta < base::TimeDelta() || update_delta > desired_delta)
202 delta = base::TimeDelta::FromSeconds(kMinUpdateIntervalSeconds); 202 delta = base::TimeDelta::FromSeconds(kMinUpdateIntervalSeconds);
203 else 203 else
204 delta = desired_delta - update_delta; 204 delta = desired_delta - update_delta;
205 205
206 timer_.Start(FROM_HERE, delta, this, &GAIAInfoUpdateService::Update); 206 timer_.Start(FROM_HERE, delta, this, &GAIAInfoUpdateService::Update);
207 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/icon_loader_win.cc ('k') | chrome/browser/tab_contents/thumbnail_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698