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 DictionaryValue* setting_dict = static_cast<DictionaryValue*>(setting); | |
91 base::Value* value; | 94 base::Value* value; |
92 if (chromeos::proxy_cros_settings_parser::GetProxyPrefValue( | 95 bool found = setting_dict->Remove("value", &value); |
93 browser->profile(), setting_path, &value)) { | 96 delete setting; |
James Hawkins
2012/08/07 17:59:05
nit: Wrap the returned value in a scoped_ptr inste
bartfab (slow)
2012/08/07 18:27:05
Done.
| |
94 return value; | 97 if (found) |
95 } | 98 return value; |
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 } | 99 } |
100 | |
108 return NULL; | 101 return NULL; |
109 } | 102 } |
110 | 103 |
111 const char* UpdateStatusToString( | 104 const char* UpdateStatusToString( |
112 UpdateEngineClient::UpdateStatusOperation status) { | 105 UpdateEngineClient::UpdateStatusOperation status) { |
113 switch (status) { | 106 switch (status) { |
114 case UpdateEngineClient::UPDATE_STATUS_IDLE: | 107 case UpdateEngineClient::UPDATE_STATUS_IDLE: |
115 return "idle"; | 108 return "idle"; |
116 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: | 109 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: |
117 return "checking for update"; | 110 return "checking for update"; |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1459 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1452 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1460 AddObserver(power_manager_observer_); | 1453 AddObserver(power_manager_observer_); |
1461 } | 1454 } |
1462 | 1455 |
1463 void TestingAutomationProvider::RemoveChromeosObservers() { | 1456 void TestingAutomationProvider::RemoveChromeosObservers() { |
1464 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1457 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1465 RemoveObserver(power_manager_observer_); | 1458 RemoveObserver(power_manager_observer_); |
1466 delete power_manager_observer_; | 1459 delete power_manager_observer_; |
1467 power_manager_observer_ = NULL; | 1460 power_manager_observer_ = NULL; |
1468 } | 1461 } |
OLD | NEW |