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

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

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 void InfoBarCountObserver::Observe( 1380 void InfoBarCountObserver::Observe(
1381 int type, 1381 int type,
1382 const content::NotificationSource& source, 1382 const content::NotificationSource& source,
1383 const content::NotificationDetails& details) { 1383 const content::NotificationDetails& details) {
1384 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED || 1384 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED ||
1385 type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED); 1385 type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED);
1386 CheckCount(); 1386 CheckCount();
1387 } 1387 }
1388 1388
1389 void InfoBarCountObserver::CheckCount() { 1389 void InfoBarCountObserver::CheckCount() {
1390 if (tab_contents_->infobar_tab_helper()->infobar_count() != target_count_) 1390 if (tab_contents_->infobar_tab_helper()->GetInfoBarCount() != target_count_)
1391 return; 1391 return;
1392 1392
1393 if (automation_) { 1393 if (automation_) {
1394 AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_.get(), 1394 AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_.get(),
1395 true); 1395 true);
1396 automation_->Send(reply_message_.release()); 1396 automation_->Send(reply_message_.release());
1397 } 1397 }
1398 delete this; 1398 delete this;
1399 } 1399 }
1400 1400
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2353 pdm_->SetObserver(this); 2353 pdm_->SetObserver(this);
2354 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED, 2354 registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED,
2355 content::NotificationService::AllSources()); 2355 content::NotificationService::AllSources());
2356 } 2356 }
2357 2357
2358 AutofillFormSubmittedObserver::~AutofillFormSubmittedObserver() { 2358 AutofillFormSubmittedObserver::~AutofillFormSubmittedObserver() {
2359 pdm_->RemoveObserver(this); 2359 pdm_->RemoveObserver(this);
2360 2360
2361 if (infobar_helper_) { 2361 if (infobar_helper_) {
2362 InfoBarDelegate* infobar = NULL; 2362 InfoBarDelegate* infobar = NULL;
2363 if (infobar_helper_->infobar_count() > 0 && 2363 if (infobar_helper_->GetInfoBarCount() > 0 &&
2364 (infobar = infobar_helper_->GetInfoBarDelegateAt(0))) { 2364 (infobar = infobar_helper_->GetInfoBarDelegateAt(0))) {
2365 infobar_helper_->RemoveInfoBar(infobar); 2365 infobar_helper_->RemoveInfoBar(infobar);
2366 } 2366 }
2367 } 2367 }
2368 } 2368 }
2369 2369
2370 void AutofillFormSubmittedObserver::OnPersonalDataChanged() { 2370 void AutofillFormSubmittedObserver::OnPersonalDataChanged() {
2371 if (automation_) { 2371 if (automation_) {
2372 AutomationJSONReply(automation_, 2372 AutomationJSONReply(automation_,
2373 reply_message_.release()).SendSuccess(NULL); 2373 reply_message_.release()).SendSuccess(NULL);
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3169 if (automation_) { 3169 if (automation_) {
3170 AutomationJSONReply(automation_, reply_message_.release()) 3170 AutomationJSONReply(automation_, reply_message_.release())
3171 .SendSuccess(NULL); 3171 .SendSuccess(NULL);
3172 } 3172 }
3173 delete this; 3173 delete this;
3174 } 3174 }
3175 } else { 3175 } else {
3176 NOTREACHED(); 3176 NOTREACHED();
3177 } 3177 }
3178 } 3178 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_metrics_unittest.cc ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698