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

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

Issue 1842643004: Add --disable-webusb-security flag for testing existing devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed and refactored FindInWebUsbAllowedOrigins. Created 4 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/usb/usb_chooser_bubble_controller.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/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 "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // This flag allows people to whitelist certain origins as secure, even 86 // This flag allows people to whitelist certain origins as secure, even
87 // if they are not. 87 // if they are not.
88 switches::kUnsafelyTreatInsecureOriginAsSecure, 88 switches::kUnsafelyTreatInsecureOriginAsSecure,
89 89
90 // This flag enables Web Bluetooth. Since the UI for Web Bluetooth is 90 // This flag enables Web Bluetooth. Since the UI for Web Bluetooth is
91 // not yet implemented, websites could take control over paired devices 91 // not yet implemented, websites could take control over paired devices
92 // without the users knowledge, so we need to show a warning for when 92 // without the users knowledge, so we need to show a warning for when
93 // the flag is enabled. 93 // the flag is enabled.
94 switches::kEnableWebBluetooth, 94 switches::kEnableWebBluetooth,
95 95
96 // This flag disables WebUSB's CORS-like checks for origin to device
97 // communication, allowing any origin to ask the user for permission to
98 // connect to a device. It is intended for manufacturers testing their
99 // existing devices until https://crbug.com/598766 is implemented.
100 switches::kDisableWebUsbSecurity,
101
96 NULL 102 NULL
97 }; 103 };
98 104
99 for (const char** flag = kBadFlags; *flag; ++flag) { 105 for (const char** flag = kBadFlags; *flag; ++flag) {
100 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) { 106 if (base::CommandLine::ForCurrentProcess()->HasSwitch(*flag)) {
101 SimpleAlertInfoBarDelegate::Create( 107 SimpleAlertInfoBarDelegate::Create(
102 InfoBarService::FromWebContents(web_contents), 108 InfoBarService::FromWebContents(web_contents),
103 infobars::InfoBarDelegate::BAD_FLAGS_PROMPT, 109 infobars::InfoBarDelegate::BAD_FLAGS_PROMPT,
104 infobars::InfoBarDelegate::kNoIconID, 110 infobars::InfoBarDelegate::kNoIconID,
105 gfx::VectorIconId::VECTOR_ICON_NONE, 111 gfx::VectorIconId::VECTOR_ICON_NONE,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 user_data_dir.LossyDisplayName()); 144 user_data_dir.LossyDisplayName());
139 145
140 if (cleanup_resource_bundle) 146 if (cleanup_resource_bundle)
141 ResourceBundle::CleanupSharedInstance(); 147 ResourceBundle::CleanupSharedInstance();
142 148
143 // More complex dialogs cannot be shown before the earliest calls here. 149 // More complex dialogs cannot be shown before the earliest calls here.
144 ShowWarningMessageBox(NULL, title, message); 150 ShowWarningMessageBox(NULL, title, message);
145 } 151 }
146 152
147 } // namespace chrome 153 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/usb/usb_chooser_bubble_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698