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

Side by Side Diff: chrome/browser/ui/startup/bad_flags_prompt.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/ui/startup/bad_flags_prompt.h" 5 #include "chrome/browser/ui/startup/bad_flags_prompt.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/api/infobars/infobar_service.h" 9 #include "chrome/browser/api/infobars/infobar_service.h"
10 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h" 10 #include "chrome/browser/api/infobars/simple_alert_infobar_delegate.h"
(...skipping 25 matching lines...) Expand all
36 if (CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { 36 if (CommandLine::ForCurrentProcess()->HasSwitch(*flag)) {
37 bad_flag = *flag; 37 bad_flag = *flag;
38 break; 38 break;
39 } 39 }
40 } 40 }
41 41
42 if (bad_flag) { 42 if (bad_flag) {
43 content::WebContents* web_contents = chrome::GetActiveWebContents(browser); 43 content::WebContents* web_contents = chrome::GetActiveWebContents(browser);
44 if (!web_contents) 44 if (!web_contents)
45 return; 45 return;
46 InfoBarService* infobar_service = 46 SimpleAlertInfoBarDelegate::Create(
47 InfoBarService::FromWebContents(web_contents); 47 InfoBarService::FromWebContents(web_contents), NULL,
48 infobar_service->AddInfoBar( 48 l10n_util::GetStringFUTF16(IDS_BAD_FLAGS_WARNING_MESSAGE,
49 new SimpleAlertInfoBarDelegate( 49 UTF8ToUTF16(std::string("--") + bad_flag)),
50 infobar_service, NULL, 50 false);
51 l10n_util::GetStringFUTF16(
52 IDS_BAD_FLAGS_WARNING_MESSAGE,
53 UTF8ToUTF16(std::string("--") + bad_flag)),
54 false));
55 } 51 }
56 } 52 }
57 53
58 } // namespace chrome 54 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/autolaunch_prompt_win.cc ('k') | chrome/browser/ui/startup/default_browser_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698