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

Side by Side Diff: chrome/browser/nacl_host/nacl_infobar.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
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/nacl_host/nacl_infobar.h" 5 #include "chrome/browser/nacl_host/nacl_infobar.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/api/infobars/infobar_service.h" 8 #include "chrome/browser/api/infobars/infobar_service.h"
9 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" 9 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 12 matching lines...) Expand all
23 23
24 void ShowInfobar(int render_process_id, int render_view_id, 24 void ShowInfobar(int render_process_id, int render_view_id,
25 int error_id) { 25 int error_id) {
26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
27 DCHECK(static_cast<PP_NaClError>(error_id) == 27 DCHECK(static_cast<PP_NaClError>(error_id) ==
28 PP_NACL_MANIFEST_MISSING_ARCH); 28 PP_NACL_MANIFEST_MISSING_ARCH);
29 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id, 29 RenderViewHost* rvh = RenderViewHost::FromID(render_process_id,
30 render_view_id); 30 render_view_id);
31 WebContents* wc = WebContents::FromRenderViewHost(rvh); 31 WebContents* wc = WebContents::FromRenderViewHost(rvh);
32 InfoBarService* ibs = InfoBarService::FromWebContents(wc); 32 InfoBarService* ibs = InfoBarService::FromWebContents(wc);
33 ibs->AddInfoBar(new SimpleAlertInfoBarDelegate(ibs, NULL, 33 SimpleAlertInfoBarDelegate::Create(ibs, NULL,
34 l10n_util::GetStringUTF16(IDS_NACL_APP_MISSING_ARCH_MESSAGE), true)); 34 l10n_util::GetStringUTF16(IDS_NACL_APP_MISSING_ARCH_MESSAGE), true);
35 } 35 }
36 36
37 } // namespace 37 } // namespace
38 38
39 void ShowNaClInfobar(int render_process_id, int render_view_id, 39 void ShowNaClInfobar(int render_process_id, int render_view_id,
40 int error_id) { 40 int error_id) {
41 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 41 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
42 base::Bind(&ShowInfobar, render_process_id, render_view_id, 42 base::Bind(&ShowInfobar, render_process_id, render_view_id,
43 error_id)); 43 error_id));
44 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698