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 "ash/shell.h" | |
8 #include "base/command_line.h" | 7 #include "base/command_line.h" |
9 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
11 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
12 #include "chromeos/network/network_handler.h" | 11 #include "chromeos/network/network_handler.h" |
13 #include "chromeos/network/network_state.h" | 12 #include "chromeos/network/network_state.h" |
14 #include "chromeos/network/network_state_handler.h" | 13 #include "chromeos/network/network_state_handler.h" |
15 #include "third_party/cros_system_api/dbus/service_constants.h" | 14 #include "third_party/cros_system_api/dbus/service_constants.h" |
16 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
17 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
18 #include "ui/gfx/screen.h" | 17 #include "ui/gfx/screen.h" |
19 | 18 |
20 namespace chromeos { | 19 namespace chromeos { |
21 | 20 |
22 gfx::Rect CalculateScreenBounds(const gfx::Size& size) { | 21 gfx::Rect CalculateScreenBounds(const gfx::Size& size) { |
23 gfx::Rect bounds(ash::Shell::GetScreen()->GetPrimaryDisplay().bounds()); | 22 gfx::Rect bounds = |
| 23 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().bounds(); |
24 if (!size.IsEmpty()) { | 24 if (!size.IsEmpty()) { |
25 int horizontal_diff = bounds.width() - size.width(); | 25 int horizontal_diff = bounds.width() - size.width(); |
26 int vertical_diff = bounds.height() - size.height(); | 26 int vertical_diff = bounds.height() - size.height(); |
27 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); | 27 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); |
28 } | 28 } |
29 return bounds; | 29 return bounds; |
30 } | 30 } |
31 | 31 |
32 int GetCurrentUserImageSize() { | 32 int GetCurrentUserImageSize() { |
33 // The biggest size that the profile picture is displayed at is currently | 33 // The biggest size that the profile picture is displayed at is currently |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 bool NetworkStateHelper::IsConnecting() const { | 85 bool NetworkStateHelper::IsConnecting() const { |
86 chromeos::NetworkStateHandler* nsh = | 86 chromeos::NetworkStateHandler* nsh = |
87 chromeos::NetworkHandler::Get()->network_state_handler(); | 87 chromeos::NetworkHandler::Get()->network_state_handler(); |
88 return nsh->ConnectingNetworkByType( | 88 return nsh->ConnectingNetworkByType( |
89 chromeos::NetworkTypePattern::Default()) != NULL; | 89 chromeos::NetworkTypePattern::Default()) != NULL; |
90 } | 90 } |
91 | 91 |
92 } // namespace login | 92 } // namespace login |
93 | 93 |
94 } // namespace chromeos | 94 } // namespace chromeos |
OLD | NEW |