| 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/chromeos/login/helper.h" | 5 #include "chrome/browser/chromeos/login/helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 gfx::Rect bounds = | 90 gfx::Rect bounds = |
| 91 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds(); | 91 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds(); |
| 92 if (!size.IsEmpty()) { | 92 if (!size.IsEmpty()) { |
| 93 int horizontal_diff = bounds.width() - size.width(); | 93 int horizontal_diff = bounds.width() - size.width(); |
| 94 int vertical_diff = bounds.height() - size.height(); | 94 int vertical_diff = bounds.height() - size.height(); |
| 95 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); | 95 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); |
| 96 } | 96 } |
| 97 return bounds; | 97 return bounds; |
| 98 } | 98 } |
| 99 | 99 |
| 100 int GetCurrentUserImageSize() { | 100 unsigned int GetCurrentUserImageSize() { |
| 101 // The biggest size that the profile picture is displayed at is currently | 101 // The biggest size that the profile picture is displayed at is currently |
| 102 // 220px, used for the big preview on OOBE and Change Picture options page. | 102 // 220px, used for the big preview on OOBE and Change Picture options page. |
| 103 static const int kBaseUserImageSize = 220; | 103 static const unsigned int kBaseUserImageSize = 220; |
| 104 float scale_factor = gfx::Display::GetForcedDeviceScaleFactor(); | 104 float scale_factor = gfx::Display::GetForcedDeviceScaleFactor(); |
| 105 if (scale_factor > 1.0f) | 105 if (scale_factor > 1.0f) |
| 106 return static_cast<int>(scale_factor * kBaseUserImageSize); | 106 return static_cast<unsigned int>(scale_factor * kBaseUserImageSize); |
| 107 return kBaseUserImageSize * gfx::ImageSkia::GetMaxSupportedScale(); | 107 return kBaseUserImageSize * gfx::ImageSkia::GetMaxSupportedScale(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 namespace login { | 110 namespace login { |
| 111 | 111 |
| 112 NetworkStateHelper::NetworkStateHelper() {} | 112 NetworkStateHelper::NetworkStateHelper() {} |
| 113 NetworkStateHelper::~NetworkStateHelper() {} | 113 NetworkStateHelper::~NetworkStateHelper() {} |
| 114 | 114 |
| 115 base::string16 NetworkStateHelper::GetCurrentNetworkName() const { | 115 base::string16 NetworkStateHelper::GetCurrentNetworkName() const { |
| 116 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); | 116 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 return signin_partition->GetURLRequestContext(); | 244 return signin_partition->GetURLRequestContext(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 return ProfileHelper::GetSigninProfile()->GetRequestContext(); | 247 return ProfileHelper::GetSigninProfile()->GetRequestContext(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace login | 250 } // namespace login |
| 251 | 251 |
| 252 } // namespace chromeos | 252 } // namespace chromeos |
| OLD | NEW |