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

Side by Side Diff: chrome/browser/infobars/infobar_extension_api.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
« no previous file with comments | « chrome/browser/infobars/infobar.cc ('k') | chrome/browser/infobars/infobar_tab_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/infobars/infobar_extension_api.h" 5 #include "chrome/browser/infobars/infobar_extension_api.h"
6 6
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" 10 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 &browser, 57 &browser,
58 NULL, 58 NULL,
59 &web_contents, 59 &web_contents,
60 NULL)) { 60 NULL)) {
61 error_ = extensions::ErrorUtils::FormatErrorMessage( 61 error_ = extensions::ErrorUtils::FormatErrorMessage(
62 extensions::tabs_constants::kTabNotFoundError, 62 extensions::tabs_constants::kTabNotFoundError,
63 base::IntToString(tab_id)); 63 base::IntToString(tab_id));
64 return false; 64 return false;
65 } 65 }
66 66
67 InfoBarService* infobar_service = 67 ExtensionInfoBarDelegate::Create(
68 InfoBarService::FromWebContents(web_contents); 68 InfoBarService::FromWebContents(web_contents), browser, GetExtension(),
69 infobar_service->AddInfoBar( 69 url, height);
70 new ExtensionInfoBarDelegate(browser, infobar_service,
71 GetExtension(), url, height));
72 70
73 // TODO(finnur): Return the actual DOMWindow object. Bug 26463. 71 // TODO(finnur): Return the actual DOMWindow object. Bug 26463.
74 DCHECK(browser->extension_window_controller()); 72 DCHECK(browser->extension_window_controller());
75 SetResult(browser->extension_window_controller()->CreateWindowValue()); 73 SetResult(browser->extension_window_controller()->CreateWindowValue());
76 74
77 return true; 75 return true;
78 } 76 }
OLDNEW
« no previous file with comments | « chrome/browser/infobars/infobar.cc ('k') | chrome/browser/infobars/infobar_tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698