| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2578 gfx::Rect rect = browser->window()->GetRestoredBounds(); | 2578 gfx::Rect rect = browser->window()->GetRestoredBounds(); |
| 2579 browser_item->SetInteger("x", rect.x()); | 2579 browser_item->SetInteger("x", rect.x()); |
| 2580 browser_item->SetInteger("y", rect.y()); | 2580 browser_item->SetInteger("y", rect.y()); |
| 2581 browser_item->SetInteger("width", rect.width()); | 2581 browser_item->SetInteger("width", rect.width()); |
| 2582 browser_item->SetInteger("height", rect.height()); | 2582 browser_item->SetInteger("height", rect.height()); |
| 2583 browser_item->SetBoolean("fullscreen", | 2583 browser_item->SetBoolean("fullscreen", |
| 2584 browser->window()->IsFullscreen()); | 2584 browser->window()->IsFullscreen()); |
| 2585 browser_item->SetInteger("selected_tab", browser->active_index()); | 2585 browser_item->SetInteger("selected_tab", browser->active_index()); |
| 2586 browser_item->SetBoolean("incognito", | 2586 browser_item->SetBoolean("incognito", |
| 2587 browser->profile()->IsOffTheRecord()); | 2587 browser->profile()->IsOffTheRecord()); |
| 2588 std::string type; |
| 2589 switch (browser->type()) { |
| 2590 case Browser::TYPE_TABBED: |
| 2591 type = "tabbed"; |
| 2592 break; |
| 2593 case Browser::TYPE_POPUP: |
| 2594 type = "popup"; |
| 2595 break; |
| 2596 case Browser::TYPE_PANEL: |
| 2597 type = "panel"; |
| 2598 break; |
| 2599 default: |
| 2600 type = "unknown"; |
| 2601 break; |
| 2602 } |
| 2603 browser_item->SetString("type", type); |
| 2588 // For each window, add info about all tabs in a list of dictionaries, | 2604 // For each window, add info about all tabs in a list of dictionaries, |
| 2589 // one dictionary item per tab. | 2605 // one dictionary item per tab. |
| 2590 ListValue* tabs = new ListValue; | 2606 ListValue* tabs = new ListValue; |
| 2591 for (int i = 0; i < browser->tab_count(); ++i) { | 2607 for (int i = 0; i < browser->tab_count(); ++i) { |
| 2592 TabContents* tc = browser->GetTabContentsAt(i); | 2608 TabContents* tc = browser->GetTabContentsAt(i); |
| 2593 DictionaryValue* tab = new DictionaryValue; | 2609 DictionaryValue* tab = new DictionaryValue; |
| 2594 tab->SetInteger("index", i); | 2610 tab->SetInteger("index", i); |
| 2595 tab->SetString("url", tc->GetURL().spec()); | 2611 tab->SetString("url", tc->GetURL().spec()); |
| 2596 tab->SetInteger("renderer_pid", | 2612 tab->SetInteger("renderer_pid", |
| 2597 base::GetProcId(tc->GetRenderProcessHost()->GetHandle())); | 2613 base::GetProcId(tc->GetRenderProcessHost()->GetHandle())); |
| (...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5866 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5882 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5867 | 5883 |
| 5868 Send(reply_message_); | 5884 Send(reply_message_); |
| 5869 redirect_query_ = 0; | 5885 redirect_query_ = 0; |
| 5870 reply_message_ = NULL; | 5886 reply_message_ = NULL; |
| 5871 } | 5887 } |
| 5872 | 5888 |
| 5873 void TestingAutomationProvider::OnRemoveProvider() { | 5889 void TestingAutomationProvider::OnRemoveProvider() { |
| 5874 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5890 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5875 } | 5891 } |
| OLD | NEW |