Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 11721003: Eliminate the LinkInfoBar[Delegate] classes entirely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: kill LinkInfoBar classes Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/file_path.h" 15 #include "base/file_path.h"
16 #include "base/json/json_reader.h" 16 #include "base/json/json_reader.h"
17 #include "base/json/json_writer.h" 17 #include "base/json/json_writer.h"
18 #include "base/json/string_escape.h" 18 #include "base/json/string_escape.h"
19 #include "base/path_service.h" 19 #include "base/path_service.h"
20 #include "base/process.h" 20 #include "base/process.h"
21 #include "base/process_util.h" 21 #include "base/process_util.h"
22 #include "base/sequenced_task_runner.h" 22 #include "base/sequenced_task_runner.h"
23 #include "base/stringprintf.h" 23 #include "base/stringprintf.h"
24 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
25 #include "base/time.h" 25 #include "base/time.h"
26 #include "base/utf_string_conversions.h" 26 #include "base/utf_string_conversions.h"
27 #include "chrome/app/chrome_command_ids.h" 27 #include "chrome/app/chrome_command_ids.h"
28 #include "chrome/browser/alternate_nav_infobar_delegate.h"
28 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" 29 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
29 #include "chrome/browser/api/infobars/infobar_service.h" 30 #include "chrome/browser/api/infobars/infobar_service.h"
30 #include "chrome/browser/api/infobars/link_infobar_delegate.h"
31 #include "chrome/browser/autocomplete/autocomplete_controller.h" 31 #include "chrome/browser/autocomplete/autocomplete_controller.h"
32 #include "chrome/browser/autocomplete/autocomplete_match.h" 32 #include "chrome/browser/autocomplete/autocomplete_match.h"
33 #include "chrome/browser/autocomplete/autocomplete_result.h" 33 #include "chrome/browser/autocomplete/autocomplete_result.h"
34 #include "chrome/browser/automation/automation_browser_tracker.h" 34 #include "chrome/browser/automation/automation_browser_tracker.h"
35 #include "chrome/browser/automation/automation_provider_json.h" 35 #include "chrome/browser/automation/automation_provider_json.h"
36 #include "chrome/browser/automation/automation_provider_list.h" 36 #include "chrome/browser/automation/automation_provider_list.h"
37 #include "chrome/browser/automation/automation_provider_observers.h" 37 #include "chrome/browser/automation/automation_provider_observers.h"
38 #include "chrome/browser/automation/automation_tab_tracker.h" 38 #include "chrome/browser/automation/automation_tab_tracker.h"
39 #include "chrome/browser/automation/automation_util.h" 39 #include "chrome/browser/automation/automation_util.h"
40 #include "chrome/browser/automation/automation_window_tracker.h" 40 #include "chrome/browser/automation/automation_window_tracker.h"
(...skipping 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 ConfirmInfoBarDelegate::BUTTON_OK)); 2156 ConfirmInfoBarDelegate::BUTTON_OK));
2157 buttons_list->Append(button_label); 2157 buttons_list->Append(button_label);
2158 } 2158 }
2159 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) { 2159 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) {
2160 StringValue* button_label = new StringValue( 2160 StringValue* button_label = new StringValue(
2161 confirm_infobar->GetButtonLabel( 2161 confirm_infobar->GetButtonLabel(
2162 ConfirmInfoBarDelegate::BUTTON_CANCEL)); 2162 ConfirmInfoBarDelegate::BUTTON_CANCEL));
2163 buttons_list->Append(button_label); 2163 buttons_list->Append(button_label);
2164 } 2164 }
2165 infobar_item->Set("buttons", buttons_list); 2165 infobar_item->Set("buttons", buttons_list);
2166 } else if (infobar->AsLinkInfoBarDelegate()) { 2166 } else if (infobar->AsAlternateNavInfoBarDelegate()) {
2167 infobar_item->SetString("type", "link_infobar"); 2167 infobar_item->SetString("type", "alternate_nav_infobar");
2168 LinkInfoBarDelegate* link_infobar = infobar->AsLinkInfoBarDelegate(); 2168 AlternateNavInfoBarDelegate* alternate_nav_infobar =
2169 infobar_item->SetString("link_text", link_infobar->GetLinkText()); 2169 infobar->AsAlternateNavInfoBarDelegate();
2170 infobar_item->SetString("link_text",
2171 alternate_nav_infobar->GetLinkText());
2170 } else if (infobar->AsExtensionInfoBarDelegate()) { 2172 } else if (infobar->AsExtensionInfoBarDelegate()) {
2171 infobar_item->SetString("type", "extension_infobar"); 2173 infobar_item->SetString("type", "extension_infobar");
2172 } else { 2174 } else {
2173 infobar_item->SetString("type", "unknown_infobar"); 2175 infobar_item->SetString("type", "unknown_infobar");
2174 } 2176 }
2175 infobars->Append(infobar_item); 2177 infobars->Append(infobar_item);
2176 } 2178 }
2177 return infobars; 2179 return infobars;
2178 } 2180 }
2179 2181
(...skipping 4096 matching lines...) Expand 10 before | Expand all | Expand 10 after
6276 if (g_browser_process) 6278 if (g_browser_process)
6277 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6279 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6278 } 6280 }
6279 6281
6280 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 6282 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
6281 WebContents* tab) { 6283 WebContents* tab) {
6282 TabStripModel* tab_strip = browser->tab_strip_model(); 6284 TabStripModel* tab_strip = browser->tab_strip_model();
6283 if (tab_strip->GetActiveWebContents() != tab) 6285 if (tab_strip->GetActiveWebContents() != tab)
6284 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 6286 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
6285 } 6287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698