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

Side by Side Diff: chrome/browser/extensions/extension_infobar_delegate.cc

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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/extensions/extension_infobar_delegate.h" 5 #include "chrome/browser/extensions/extension_infobar_delegate.h"
6 6
7 #include "chrome/browser/extensions/extension_host.h" 7 #include "chrome/browser/extensions/extension_host.h"
8 #include "chrome/browser/extensions/extension_process_manager.h" 8 #include "chrome/browser/extensions/extension_process_manager.h"
9 #include "chrome/browser/infobars/infobar.h" 9 #include "chrome/browser/infobars/infobar.h"
10 #include "chrome/browser/infobars/infobar_tab_helper.h" 10 #include "chrome/browser/infobars/infobar_tab_helper.h"
(...skipping 11 matching lines...) Expand all
22 const GURL& url, 22 const GURL& url,
23 int height) 23 int height)
24 : InfoBarDelegate(infobar_helper), 24 : InfoBarDelegate(infobar_helper),
25 browser_(browser), 25 browser_(browser),
26 observer_(NULL), 26 observer_(NULL),
27 extension_(extension), 27 extension_(extension),
28 closing_(false) { 28 closing_(false) {
29 ExtensionProcessManager* manager = 29 ExtensionProcessManager* manager =
30 browser->profile()->GetExtensionProcessManager(); 30 browser->profile()->GetExtensionProcessManager();
31 extension_host_.reset(manager->CreateInfobarHost(url, browser)); 31 extension_host_.reset(manager->CreateInfobarHost(url, browser));
32 extension_host_->SetAssociatedWebContents(infobar_helper->web_contents()); 32 extension_host_->SetAssociatedWebContents(infobar_helper->GetWebContents());
33 33
34 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, 34 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
35 content::Source<Profile>(browser->profile())); 35 content::Source<Profile>(browser->profile()));
36 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 36 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
37 content::Source<Profile>(browser->profile())); 37 content::Source<Profile>(browser->profile()));
38 38
39 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) 39 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK)
40 int default_height = InfoBar::kDefaultBarTargetHeight; 40 int default_height = InfoBar::kDefaultBarTargetHeight;
41 #elif defined(OS_MACOSX) 41 #elif defined(OS_MACOSX)
42 // TODO(pkasting): Once Infobars have been ported to Mac, we can remove the 42 // TODO(pkasting): Once Infobars have been ported to Mac, we can remove the
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 RemoveSelf(); 97 RemoveSelf();
98 } else { 98 } else {
99 DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED); 99 DCHECK(type == chrome::NOTIFICATION_EXTENSION_UNLOADED);
100 if (extension_ == 100 if (extension_ ==
101 content::Details<extensions::UnloadedExtensionInfo>( 101 content::Details<extensions::UnloadedExtensionInfo>(
102 details)->extension) { 102 details)->extension) {
103 RemoveSelf(); 103 RemoveSelf();
104 } 104 }
105 } 105 }
106 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698