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

Side by Side Diff: chrome/browser/extensions/api/messaging/incognito_connectability.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on Android Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/api/messaging/incognito_connectability.h" 5 #include "chrome/browser/extensions/api/messaging/incognito_connectability.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 20 matching lines...) Expand all
31 class IncognitoConnectabilityInfoBarDelegate : public ConfirmInfoBarDelegate { 31 class IncognitoConnectabilityInfoBarDelegate : public ConfirmInfoBarDelegate {
32 public: 32 public:
33 typedef base::Callback<void( 33 typedef base::Callback<void(
34 IncognitoConnectability::ScopedAlertTracker::Mode)> InfoBarCallback; 34 IncognitoConnectability::ScopedAlertTracker::Mode)> InfoBarCallback;
35 35
36 // Creates a confirmation infobar and delegate and adds the infobar to 36 // Creates a confirmation infobar and delegate and adds the infobar to
37 // |infobar_service|. 37 // |infobar_service|.
38 static InfoBar* Create(InfoBarManager* infobar_manager, 38 static InfoBar* Create(InfoBarManager* infobar_manager,
39 const base::string16& message, 39 const base::string16& message,
40 const InfoBarCallback& callback) { 40 const InfoBarCallback& callback) {
41 return infobar_manager->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( 41 return infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar(
42 scoped_ptr<ConfirmInfoBarDelegate>( 42 scoped_ptr<ConfirmInfoBarDelegate>(
43 new IncognitoConnectabilityInfoBarDelegate(message, callback)))); 43 new IncognitoConnectabilityInfoBarDelegate(message, callback))));
44 } 44 }
45 45
46 // Set the infobar answered so that the callback is not executed when the 46 // Set the infobar answered so that the callback is not executed when the
47 // delegate is destroyed. 47 // delegate is destroyed.
48 void SetAnswered() { answered_ = true; } 48 void SetAnswered() { answered_ = true; }
49 49
50 private: 50 private:
51 IncognitoConnectabilityInfoBarDelegate(const base::string16& message, 51 IncognitoConnectabilityInfoBarDelegate(const base::string16& message,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 BrowserContextKeyedAPIFactory<IncognitoConnectability> > g_factory = 258 BrowserContextKeyedAPIFactory<IncognitoConnectability> > g_factory =
259 LAZY_INSTANCE_INITIALIZER; 259 LAZY_INSTANCE_INITIALIZER;
260 260
261 // static 261 // static
262 BrowserContextKeyedAPIFactory<IncognitoConnectability>* 262 BrowserContextKeyedAPIFactory<IncognitoConnectability>*
263 IncognitoConnectability::GetFactoryInstance() { 263 IncognitoConnectability::GetFactoryInstance() {
264 return g_factory.Pointer(); 264 return g_factory.Pointer();
265 } 265 }
266 266
267 } // namespace extensions 267 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/debugger/debugger_api.cc ('k') | chrome/browser/extensions/theme_installed_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698