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" | 7 #include "ash/shell.h" |
| 8 #include "base/command_line.h" |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/chromeos/login/users/user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/user_manager.h" |
| 11 #include "chromeos/chromeos_switches.h" |
10 #include "chromeos/network/network_handler.h" | 12 #include "chromeos/network/network_handler.h" |
11 #include "chromeos/network/network_state.h" | 13 #include "chromeos/network/network_state.h" |
12 #include "chromeos/network/network_state_handler.h" | 14 #include "chromeos/network/network_state_handler.h" |
13 #include "chromeos/network/shill_property_util.h" | 15 #include "chromeos/network/shill_property_util.h" |
14 #include "google_apis/gaia/gaia_auth_util.h" | 16 #include "google_apis/gaia/gaia_auth_util.h" |
15 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
16 #include "grit/theme_resources.h" | 18 #include "grit/theme_resources.h" |
17 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
18 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
(...skipping 23 matching lines...) Expand all Loading... |
43 } | 45 } |
44 | 46 |
45 namespace login { | 47 namespace login { |
46 | 48 |
47 std::string CanonicalizeUserID(const std::string& user_id) { | 49 std::string CanonicalizeUserID(const std::string& user_id) { |
48 if (user_id == UserManager::kGuestUserName) | 50 if (user_id == UserManager::kGuestUserName) |
49 return user_id; | 51 return user_id; |
50 return gaia::CanonicalizeEmail(user_id); | 52 return gaia::CanonicalizeEmail(user_id); |
51 } | 53 } |
52 | 54 |
| 55 bool LoginScrollIntoViewEnabled() { |
| 56 return !CommandLine::ForCurrentProcess()->HasSwitch( |
| 57 chromeos::switches::kDisableLoginScrollIntoView); |
| 58 } |
| 59 |
53 NetworkStateHelper::NetworkStateHelper() {} | 60 NetworkStateHelper::NetworkStateHelper() {} |
54 NetworkStateHelper::~NetworkStateHelper() {} | 61 NetworkStateHelper::~NetworkStateHelper() {} |
55 | 62 |
56 base::string16 NetworkStateHelper::GetCurrentNetworkName() const { | 63 base::string16 NetworkStateHelper::GetCurrentNetworkName() const { |
57 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); | 64 NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler(); |
58 const NetworkState* network = | 65 const NetworkState* network = |
59 nsh->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); | 66 nsh->ConnectedNetworkByType(NetworkTypePattern::NonVirtual()); |
60 if (network) { | 67 if (network) { |
61 if (network->Matches(NetworkTypePattern::Ethernet())) | 68 if (network->Matches(NetworkTypePattern::Ethernet())) |
62 return l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); | 69 return l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); |
(...skipping 19 matching lines...) Expand all Loading... |
82 bool NetworkStateHelper::IsConnecting() const { | 89 bool NetworkStateHelper::IsConnecting() const { |
83 chromeos::NetworkStateHandler* nsh = | 90 chromeos::NetworkStateHandler* nsh = |
84 chromeos::NetworkHandler::Get()->network_state_handler(); | 91 chromeos::NetworkHandler::Get()->network_state_handler(); |
85 return nsh->ConnectingNetworkByType( | 92 return nsh->ConnectingNetworkByType( |
86 chromeos::NetworkTypePattern::Default()) != NULL; | 93 chromeos::NetworkTypePattern::Default()) != NULL; |
87 } | 94 } |
88 | 95 |
89 } // namespace login | 96 } // namespace login |
90 | 97 |
91 } // namespace chromeos | 98 } // namespace chromeos |
OLD | NEW |