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

Side by Side Diff: chrome/browser/intents/register_intent_handler_helper.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <string>
6
7 #include "chrome/browser/api/infobars/infobar_service.h"
8 #include "chrome/browser/favicon/favicon_service.h"
9 #include "chrome/browser/favicon/favicon_service_factory.h"
10 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h"
11 #include "chrome/browser/intents/web_intents_registry_factory.h"
12 #include "chrome/browser/intents/web_intents_util.h"
13 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/ui/browser.h"
15 #include "content/public/browser/web_contents.h"
16 #include "webkit/glue/web_intent_service_data.h"
17
18 using content::WebContents;
19
20 // static
21 void Browser::RegisterIntentHandlerHelper(
22 WebContents* web_contents,
23 const webkit_glue::WebIntentServiceData& data,
24 bool user_gesture) {
25 Profile* profile =
26 Profile::FromBrowserContext(web_contents->GetBrowserContext());
27 if (profile->IsOffTheRecord())
28 return;
29
30 if (!web_intents::IsWebIntentsEnabledForProfile(profile))
31 return;
32
33 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
34 profile, Profile::EXPLICIT_ACCESS);
35
36 RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar(
37 InfoBarService::FromWebContents(web_contents),
38 WebIntentsRegistryFactory::GetForProfile(profile),
39 data,
40 favicon_service,
41 web_contents->GetURL());
42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698