OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 2686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 reply.SendError(error_msg); | 2697 reply.SendError(error_msg); |
2698 return; | 2698 return; |
2699 } | 2699 } |
2700 if (!args->GetBoolean("is_visible", &is_visible)) { | 2700 if (!args->GetBoolean("is_visible", &is_visible)) { |
2701 reply.SendError("'is_visible' missing or invalid."); | 2701 reply.SendError("'is_visible' missing or invalid."); |
2702 return; | 2702 return; |
2703 } | 2703 } |
2704 if (is_visible) { | 2704 if (is_visible) { |
2705 browser->window()->GetDownloadShelf()->Show(); | 2705 browser->window()->GetDownloadShelf()->Show(); |
2706 } else { | 2706 } else { |
2707 browser->window()->GetDownloadShelf()->Close(); | 2707 browser->window()->GetDownloadShelf()->Close(DownloadShelf::AUTOMATIC); |
2708 } | 2708 } |
2709 reply.SendSuccess(NULL); | 2709 reply.SendSuccess(NULL); |
2710 } | 2710 } |
2711 | 2711 |
2712 void TestingAutomationProvider::IsDownloadShelfVisibleJSON( | 2712 void TestingAutomationProvider::IsDownloadShelfVisibleJSON( |
2713 DictionaryValue* args, | 2713 DictionaryValue* args, |
2714 IPC::Message* reply_message) { | 2714 IPC::Message* reply_message) { |
2715 AutomationJSONReply reply(this, reply_message); | 2715 AutomationJSONReply reply(this, reply_message); |
2716 Browser* browser; | 2716 Browser* browser; |
2717 std::string error_msg; | 2717 std::string error_msg; |
(...skipping 3200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5918 if (g_browser_process) | 5918 if (g_browser_process) |
5919 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5919 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
5920 } | 5920 } |
5921 | 5921 |
5922 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5922 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
5923 WebContents* tab) { | 5923 WebContents* tab) { |
5924 TabStripModel* tab_strip = browser->tab_strip_model(); | 5924 TabStripModel* tab_strip = browser->tab_strip_model(); |
5925 if (tab_strip->GetActiveWebContents() != tab) | 5925 if (tab_strip->GetActiveWebContents() != tab) |
5926 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5926 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
5927 } | 5927 } |
OLD | NEW |