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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2146 ConfirmInfoBarDelegate::BUTTON_OK)); | 2146 ConfirmInfoBarDelegate::BUTTON_OK)); |
2147 buttons_list->Append(button_label); | 2147 buttons_list->Append(button_label); |
2148 } | 2148 } |
2149 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) { | 2149 if (buttons & ConfirmInfoBarDelegate::BUTTON_CANCEL) { |
2150 StringValue* button_label = new StringValue( | 2150 StringValue* button_label = new StringValue( |
2151 confirm_infobar->GetButtonLabel( | 2151 confirm_infobar->GetButtonLabel( |
2152 ConfirmInfoBarDelegate::BUTTON_CANCEL)); | 2152 ConfirmInfoBarDelegate::BUTTON_CANCEL)); |
2153 buttons_list->Append(button_label); | 2153 buttons_list->Append(button_label); |
2154 } | 2154 } |
2155 infobar_item->Set("buttons", buttons_list); | 2155 infobar_item->Set("buttons", buttons_list); |
2156 } else if (infobar->AsAlertInfoBarDelegate()) { | |
2157 infobar_item->SetString("type", "alert_infobar"); | |
2158 AlertInfoBarDelegate* alert_infobar = | |
2159 infobar->AsAlertInfoBarDelegate(); | |
2160 infobar_item->SetString("text", alert_infobar->GetMessageText()); | |
2161 } else if (infobar->AsLinkInfoBarDelegate()) { | 2156 } else if (infobar->AsLinkInfoBarDelegate()) { |
2162 infobar_item->SetString("type", "link_infobar"); | 2157 infobar_item->SetString("type", "link_infobar"); |
2163 LinkInfoBarDelegate* link_infobar = infobar->AsLinkInfoBarDelegate(); | 2158 LinkInfoBarDelegate* link_infobar = infobar->AsLinkInfoBarDelegate(); |
2164 infobar_item->SetString("link_text", link_infobar->GetLinkText()); | 2159 infobar_item->SetString("link_text", link_infobar->GetLinkText()); |
2165 } else if (infobar->AsTranslateInfoBarDelegate()) { | 2160 } else if (infobar->AsTranslateInfoBarDelegate()) { |
2166 infobar_item->SetString("type", "translate_infobar"); | 2161 infobar_item->SetString("type", "translate_infobar"); |
2167 TranslateInfoBarDelegate* translate_infobar = | 2162 TranslateInfoBarDelegate* translate_infobar = |
2168 infobar->AsTranslateInfoBarDelegate(); | 2163 infobar->AsTranslateInfoBarDelegate(); |
2169 infobar_item->SetString("original_lang_code", | 2164 infobar_item->SetString("original_lang_code", |
2170 translate_infobar->GetOriginalLanguageCode()); | 2165 translate_infobar->GetOriginalLanguageCode()); |
(...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4514 // If you change this, update Observer for NotificationType::SESSION_END | 4509 // If you change this, update Observer for NotificationType::SESSION_END |
4515 // below. | 4510 // below. |
4516 MessageLoop::current()->PostTask(FROM_HERE, | 4511 MessageLoop::current()->PostTask(FROM_HERE, |
4517 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); | 4512 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); |
4518 } | 4513 } |
4519 } | 4514 } |
4520 | 4515 |
4521 void TestingAutomationProvider::OnRemoveProvider() { | 4516 void TestingAutomationProvider::OnRemoveProvider() { |
4522 AutomationProviderList::GetInstance()->RemoveProvider(this); | 4517 AutomationProviderList::GetInstance()->RemoveProvider(this); |
4523 } | 4518 } |
OLD | NEW |