OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/message_box_flags.h" | 7 #include "app/message_box_flags.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 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2329 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for | 2329 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for |
2330 // sample json output. | 2330 // sample json output. |
2331 void TestingAutomationProvider::GetBrowserInfo( | 2331 void TestingAutomationProvider::GetBrowserInfo( |
2332 Browser* browser, | 2332 Browser* browser, |
2333 DictionaryValue* args, | 2333 DictionaryValue* args, |
2334 IPC::Message* reply_message) { | 2334 IPC::Message* reply_message) { |
2335 base::ThreadRestrictions::ScopedAllowIO allow_io; // needed for PathService | 2335 base::ThreadRestrictions::ScopedAllowIO allow_io; // needed for PathService |
2336 DictionaryValue* properties = new DictionaryValue; | 2336 DictionaryValue* properties = new DictionaryValue; |
2337 properties->SetString("ChromeVersion", chrome::kChromeVersion); | 2337 properties->SetString("ChromeVersion", chrome::kChromeVersion); |
2338 properties->SetString("BrowserProcessExecutableName", | 2338 properties->SetString("BrowserProcessExecutableName", |
2339 WideToUTF16Hack(chrome::kBrowserProcessExecutableName)); | 2339 chrome::kBrowserProcessExecutableName); |
2340 properties->SetString("HelperProcessExecutableName", | 2340 properties->SetString("HelperProcessExecutableName", |
2341 WideToUTF16Hack(chrome::kHelperProcessExecutableName)); | 2341 chrome::kHelperProcessExecutableName); |
2342 properties->SetString("BrowserProcessExecutablePath", | 2342 properties->SetString("BrowserProcessExecutablePath", |
2343 WideToUTF16Hack(chrome::kBrowserProcessExecutablePath)); | 2343 chrome::kBrowserProcessExecutablePath); |
2344 properties->SetString("HelperProcessExecutablePath", | 2344 properties->SetString("HelperProcessExecutablePath", |
2345 chrome::kHelperProcessExecutablePath); | 2345 chrome::kHelperProcessExecutablePath); |
2346 properties->SetString("command_line_string", | 2346 properties->SetString("command_line_string", |
2347 CommandLine::ForCurrentProcess()->command_line_string()); | 2347 CommandLine::ForCurrentProcess()->command_line_string()); |
2348 FilePath dumps_path; | 2348 FilePath dumps_path; |
2349 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); | 2349 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); |
2350 properties->SetString("DIR_CRASH_DUMPS", dumps_path.value()); | 2350 properties->SetString("DIR_CRASH_DUMPS", dumps_path.value()); |
2351 | 2351 |
2352 std::string branding; | 2352 std::string branding; |
2353 #if defined(GOOGLE_CHROME_BUILD) | 2353 #if defined(GOOGLE_CHROME_BUILD) |
(...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4523 // If you change this, update Observer for NotificationType::SESSION_END | 4523 // If you change this, update Observer for NotificationType::SESSION_END |
4524 // below. | 4524 // below. |
4525 MessageLoop::current()->PostTask(FROM_HERE, | 4525 MessageLoop::current()->PostTask(FROM_HERE, |
4526 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); | 4526 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); |
4527 } | 4527 } |
4528 } | 4528 } |
4529 | 4529 |
4530 void TestingAutomationProvider::OnRemoveProvider() { | 4530 void TestingAutomationProvider::OnRemoveProvider() { |
4531 AutomationProviderList::GetInstance()->RemoveProvider(this); | 4531 AutomationProviderList::GetInstance()->RemoveProvider(this); |
4532 } | 4532 } |
OLD | NEW |