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

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

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 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
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 19 matching lines...) Expand all
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_host.h" 34 #include "chrome/browser/extensions/extension_host.h"
35 #include "chrome/browser/extensions/extension_service.h" 35 #include "chrome/browser/extensions/extension_service.h"
36 #include "chrome/browser/extensions/extension_tab_util.h" 36 #include "chrome/browser/extensions/extension_tab_util.h"
37 #include "chrome/browser/history/history_types.h" 37 #include "chrome/browser/history/history_types.h"
38 #include "chrome/browser/history/top_sites.h" 38 #include "chrome/browser/history/top_sites.h"
39 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 39 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
40 #include "chrome/browser/infobars/infobar_manager.h"
40 #include "chrome/browser/infobars/infobar_service.h" 41 #include "chrome/browser/infobars/infobar_service.h"
41 #include "chrome/browser/metrics/metric_event_duration_details.h" 42 #include "chrome/browser/metrics/metric_event_duration_details.h"
42 #include "chrome/browser/profiles/profile.h" 43 #include "chrome/browser/profiles/profile.h"
43 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" 44 #include "chrome/browser/renderer_host/chrome_render_message_filter.h"
44 #include "chrome/browser/search_engines/template_url_service.h" 45 #include "chrome/browser/search_engines/template_url_service.h"
45 #include "chrome/browser/search_engines/template_url_service_factory.h" 46 #include "chrome/browser/search_engines/template_url_service_factory.h"
46 #include "chrome/browser/sessions/session_tab_helper.h" 47 #include "chrome/browser/sessions/session_tab_helper.h"
47 #include "chrome/browser/sessions/tab_restore_service.h" 48 #include "chrome/browser/sessions/tab_restore_service.h"
48 #include "chrome/browser/sessions/tab_restore_service_factory.h" 49 #include "chrome/browser/sessions/tab_restore_service_factory.h"
49 #include "chrome/browser/ui/browser.h" 50 #include "chrome/browser/ui/browser.h"
(...skipping 1157 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 if (InfoBarService::FromWebContents(web_contents_)
1218 target_count_) 1219 ->infobar_manager()
1220 .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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 if (automation_.get()) { 2386 if (automation_.get()) {
2385 AutomationJSONReply(automation_.get(), reply_message_.release()) 2387 AutomationJSONReply(automation_.get(), reply_message_.release())
2386 .SendSuccess(NULL); 2388 .SendSuccess(NULL);
2387 } 2389 }
2388 delete this; 2390 delete this;
2389 } 2391 }
2390 } else { 2392 } else {
2391 NOTREACHED(); 2393 NOTREACHED();
2392 } 2394 }
2393 } 2395 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698