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

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

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 years, 8 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 18 matching lines...) Expand all
29 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 29 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
30 #include "chrome/browser/browser_process.h" 30 #include "chrome/browser/browser_process.h"
31 #include "chrome/browser/chrome_notification_types.h" 31 #include "chrome/browser/chrome_notification_types.h"
32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 32 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
33 #include "chrome/browser/extensions/crx_installer.h" 33 #include "chrome/browser/extensions/crx_installer.h"
34 #include "chrome/browser/extensions/extension_service.h" 34 #include "chrome/browser/extensions/extension_service.h"
35 #include "chrome/browser/extensions/extension_tab_util.h" 35 #include "chrome/browser/extensions/extension_tab_util.h"
36 #include "chrome/browser/history/history_types.h" 36 #include "chrome/browser/history/history_types.h"
37 #include "chrome/browser/history/top_sites.h" 37 #include "chrome/browser/history/top_sites.h"
38 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 38 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
39 #include "chrome/browser/infobars/infobar_manager.h"
39 #include "chrome/browser/infobars/infobar_service.h" 40 #include "chrome/browser/infobars/infobar_service.h"
40 #include "chrome/browser/metrics/metric_event_duration_details.h" 41 #include "chrome/browser/metrics/metric_event_duration_details.h"
41 #include "chrome/browser/profiles/profile.h" 42 #include "chrome/browser/profiles/profile.h"
42 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" 43 #include "chrome/browser/renderer_host/chrome_render_message_filter.h"
43 #include "chrome/browser/search_engines/template_url_service.h" 44 #include "chrome/browser/search_engines/template_url_service.h"
44 #include "chrome/browser/search_engines/template_url_service_factory.h" 45 #include "chrome/browser/search_engines/template_url_service_factory.h"
45 #include "chrome/browser/sessions/session_tab_helper.h" 46 #include "chrome/browser/sessions/session_tab_helper.h"
46 #include "chrome/browser/sessions/tab_restore_service.h" 47 #include "chrome/browser/sessions/tab_restore_service.h"
47 #include "chrome/browser/sessions/tab_restore_service_factory.h" 48 #include "chrome/browser/sessions/tab_restore_service_factory.h"
48 #include "chrome/browser/ui/browser.h" 49 #include "chrome/browser/ui/browser.h"
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 void InfoBarCountObserver::Observe( 1208 void InfoBarCountObserver::Observe(
1208 int type, 1209 int type,
1209 const content::NotificationSource& source, 1210 const content::NotificationSource& source,
1210 const content::NotificationDetails& details) { 1211 const content::NotificationDetails& details) {
1211 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED || 1212 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_ADDED ||
1212 type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED); 1213 type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED);
1213 CheckCount(); 1214 CheckCount();
1214 } 1215 }
1215 1216
1216 void InfoBarCountObserver::CheckCount() { 1217 void InfoBarCountObserver::CheckCount() {
1217 if (InfoBarService::FromWebContents(web_contents_)->infobar_count() != 1218 InfoBarService* infobar_service =
1218 target_count_) 1219 InfoBarService::FromWebContents(web_contents_);
1220 if (infobar_service->infobar_manager()->infobar_count() != target_count_)
1219 return; 1221 return;
1220 1222
1221 if (automation_.get()) { 1223 if (automation_.get()) {
1222 AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_.get(), 1224 AutomationMsg_WaitForInfoBarCount::WriteReplyParams(reply_message_.get(),
1223 true); 1225 true);
1224 automation_->Send(reply_message_.release()); 1226 automation_->Send(reply_message_.release());
1225 } 1227 }
1226 delete this; 1228 delete this;
1227 } 1229 }
1228 1230
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 if (automation_.get()) { 2385 if (automation_.get()) {
2384 AutomationJSONReply(automation_.get(), reply_message_.release()) 2386 AutomationJSONReply(automation_.get(), reply_message_.release())
2385 .SendSuccess(NULL); 2387 .SendSuccess(NULL);
2386 } 2388 }
2387 delete this; 2389 delete this;
2388 } 2390 }
2389 } else { 2391 } else {
2390 NOTREACHED(); 2392 NOTREACHED();
2391 } 2393 }
2392 } 2394 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_interactive_uitest.cc ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698