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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 item->SetBoolean("encrypted", wifi->encrypted()); | 80 item->SetBoolean("encrypted", wifi->encrypted()); |
81 item->SetString("encryption", wifi->GetEncryptionString()); | 81 item->SetString("encryption", wifi->GetEncryptionString()); |
82 return item; | 82 return item; |
83 } | 83 } |
84 | 84 |
85 base::Value* GetProxySetting(Browser* browser, | 85 base::Value* GetProxySetting(Browser* browser, |
86 const std::string& setting_name) { | 86 const std::string& setting_name) { |
87 std::string setting_path = "cros.session.proxy."; | 87 std::string setting_path = "cros.session.proxy."; |
88 setting_path.append(setting_name); | 88 setting_path.append(setting_name); |
89 | 89 |
90 if (setting_name == "ignorelist") { | 90 base::Value* setting; |
| 91 if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue( |
| 92 browser->profile(), setting_path, &setting)) { |
| 93 scoped_ptr<DictionaryValue> setting_dict( |
| 94 static_cast<DictionaryValue*>(setting)); |
91 base::Value* value; | 95 base::Value* value; |
92 if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue( | 96 if (setting_dict->Remove("value", &value)) |
93 browser->profile(), setting_path, &value)) { | 97 return value; |
94 return value; | |
95 } | |
96 } else { | |
97 base::Value* setting; | |
98 if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue( | |
99 browser->profile(), setting_path, &setting)) { | |
100 DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting); | |
101 base::Value* value; | |
102 bool found = setting_dict->Remove("value", &value); | |
103 delete setting; | |
104 if (found) | |
105 return value; | |
106 } | |
107 } | 98 } |
| 99 |
108 return NULL; | 100 return NULL; |
109 } | 101 } |
110 | 102 |
111 const char* UpdateStatusToString( | 103 const char* UpdateStatusToString( |
112 UpdateEngineClient::UpdateStatusOperation status) { | 104 UpdateEngineClient::UpdateStatusOperation status) { |
113 switch (status) { | 105 switch (status) { |
114 case UpdateEngineClient::UPDATE_STATUS_IDLE: | 106 case UpdateEngineClient::UPDATE_STATUS_IDLE: |
115 return "idle"; | 107 return "idle"; |
116 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: | 108 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: |
117 return "checking for update"; | 109 return "checking for update"; |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1451 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1460 AddObserver(power_manager_observer_); | 1452 AddObserver(power_manager_observer_); |
1461 } | 1453 } |
1462 | 1454 |
1463 void TestingAutomationProvider::RemoveChromeosObservers() { | 1455 void TestingAutomationProvider::RemoveChromeosObservers() { |
1464 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1456 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1465 RemoveObserver(power_manager_observer_); | 1457 RemoveObserver(power_manager_observer_); |
1466 delete power_manager_observer_; | 1458 delete power_manager_observer_; |
1467 power_manager_observer_ = NULL; | 1459 power_manager_observer_ = NULL; |
1468 } | 1460 } |
OLD | NEW |