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 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3529 | 3529 |
3530 // Sample json input: { "command": "GetInstantInfo" } | 3530 // Sample json input: { "command": "GetInstantInfo" } |
3531 void TestingAutomationProvider::GetInstantInfo(Browser* browser, | 3531 void TestingAutomationProvider::GetInstantInfo(Browser* browser, |
3532 DictionaryValue* args, | 3532 DictionaryValue* args, |
3533 IPC::Message* reply_message) { | 3533 IPC::Message* reply_message) { |
3534 DictionaryValue* info = new DictionaryValue; | 3534 DictionaryValue* info = new DictionaryValue; |
3535 if (browser->instant()) { | 3535 if (browser->instant()) { |
3536 InstantController* instant = browser->instant(); | 3536 InstantController* instant = browser->instant(); |
3537 info->SetBoolean("enabled", true); | 3537 info->SetBoolean("enabled", true); |
3538 info->SetBoolean("showing", instant->is_displayable()); | 3538 info->SetBoolean("showing", instant->is_displayable()); |
3539 info->SetBoolean("active", instant->is_active()); | 3539 // TODO: can we remove this? |
| 3540 info->SetBoolean("active", (instant->GetPreviewContents() != NULL)); |
3540 info->SetBoolean("current", instant->IsCurrent()); | 3541 info->SetBoolean("current", instant->IsCurrent()); |
3541 if (instant->GetPreviewContents() && | 3542 if (instant->GetPreviewContents() && |
3542 instant->GetPreviewContents()->tab_contents()) { | 3543 instant->GetPreviewContents()->tab_contents()) { |
3543 TabContents* contents = instant->GetPreviewContents()->tab_contents(); | 3544 TabContents* contents = instant->GetPreviewContents()->tab_contents(); |
3544 info->SetBoolean("loading", contents->IsLoading()); | 3545 info->SetBoolean("loading", contents->IsLoading()); |
3545 info->SetString("location", contents->GetURL().spec()); | 3546 info->SetString("location", contents->GetURL().spec()); |
3546 info->SetString("title", contents->GetTitle()); | 3547 info->SetString("title", contents->GetTitle()); |
3547 } | 3548 } |
3548 } else { | 3549 } else { |
3549 info->SetBoolean("enabled", false); | 3550 info->SetBoolean("enabled", false); |
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6526 | 6527 |
6527 Send(reply_message_); | 6528 Send(reply_message_); |
6528 redirect_query_ = 0; | 6529 redirect_query_ = 0; |
6529 reply_message_ = NULL; | 6530 reply_message_ = NULL; |
6530 } | 6531 } |
6531 | 6532 |
6532 void TestingAutomationProvider::OnRemoveProvider() { | 6533 void TestingAutomationProvider::OnRemoveProvider() { |
6533 if (g_browser_process) | 6534 if (g_browser_process) |
6534 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6535 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6535 } | 6536 } |
OLD | NEW |