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

Side by Side Diff: chrome/browser/ui/startup/bad_flags_prompt.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 5 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 (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/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // the flag is enabled. 92 // the flag is enabled.
93 switches::kEnableWebBluetooth, 93 switches::kEnableWebBluetooth,
94 94
95 NULL 95 NULL
96 }; 96 };
97 97
98 for (const char** flag = kBadFlags; *flag; ++flag) { 98 for (const char** flag = kBadFlags; *flag; ++flag) {
99 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { 99 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) {
100 SimpleAlertInfoBarDelegate::Create( 100 SimpleAlertInfoBarDelegate::Create(
101 InfoBarService::FromWebContents(web_contents), 101 InfoBarService::FromWebContents(web_contents),
102 "BadFlagsPrompt",
102 infobars::InfoBarDelegate::kNoIconID, 103 infobars::InfoBarDelegate::kNoIconID,
103 gfx::VectorIconId::VECTOR_ICON_NONE, 104 gfx::VectorIconId::VECTOR_ICON_NONE,
104 l10n_util::GetStringFUTF16( 105 l10n_util::GetStringFUTF16(
105 IDS_BAD_FLAGS_WARNING_MESSAGE, 106 IDS_BAD_FLAGS_WARNING_MESSAGE,
106 base::UTF8ToUTF16(std::string("--") + *flag)), 107 base::UTF8ToUTF16(std::string("--") + *flag)),
107 false); 108 false);
108 return; 109 return;
109 } 110 }
110 } 111 }
111 } 112 }
(...skipping 24 matching lines...) Expand all
136 user_data_dir.LossyDisplayName()); 137 user_data_dir.LossyDisplayName());
137 138
138 if (cleanup_resource_bundle) 139 if (cleanup_resource_bundle)
139 ResourceBundle::CleanupSharedInstance(); 140 ResourceBundle::CleanupSharedInstance();
140 141
141 // More complex dialogs cannot be shown before the earliest calls here. 142 // More complex dialogs cannot be shown before the earliest calls here.
142 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING); 143 ShowMessageBox(NULL, title, message, chrome::MESSAGE_BOX_TYPE_WARNING);
143 } 144 }
144 145
145 } // namespace chrome 146 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698