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

Side by Side Diff: chrome/browser/password_manager/password_manager_util_win.cc

Issue 909183002: win/aura: Remove some more non-aura code for Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 | « chrome/browser/metro_utils/metro_chrome_win.cc ('k') | chrome/browser/platform_util_win.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // windows.h must be first otherwise Win8 SDK breaks. 5 // windows.h must be first otherwise Win8 SDK breaks.
6 #include <windows.h> 6 #include <windows.h>
7 #include <LM.h> 7 #include <LM.h>
8 #include <wincred.h> 8 #include <wincred.h>
9 9
10 // SECURITY_WIN32 must be defined in order to get 10 // SECURITY_WIN32 must be defined in order to get
(...skipping 10 matching lines...) Expand all
21 #include "base/threading/worker_pool.h" 21 #include "base/threading/worker_pool.h"
22 #include "base/time/time.h" 22 #include "base/time/time.h"
23 #include "base/win/windows_version.h" 23 #include "base/win/windows_version.h"
24 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
25 #include "chrome/grit/chromium_strings.h" 25 #include "chrome/grit/chromium_strings.h"
26 #include "components/password_manager/core/browser/password_manager.h" 26 #include "components/password_manager/core/browser/password_manager.h"
27 #include "components/password_manager/core/common/password_manager_pref_names.h" 27 #include "components/password_manager/core/common/password_manager_pref_names.h"
28 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/render_view_host.h" 29 #include "content/public/browser/render_view_host.h"
30 #include "content/public/browser/render_widget_host_view.h" 30 #include "content/public/browser/render_widget_host_view.h"
31 #include "ui/base/l10n/l10n_util.h"
32
33 #if defined(USE_AURA)
34 #include "ui/aura/window.h" 31 #include "ui/aura/window.h"
35 #include "ui/aura/window_tree_host.h" 32 #include "ui/aura/window_tree_host.h"
36 #endif 33 #include "ui/base/l10n/l10n_util.h"
37 34
38 namespace password_manager_util { 35 namespace password_manager_util {
39 namespace { 36 namespace {
40 37
41 const unsigned kMaxPasswordRetries = 3; 38 const unsigned kMaxPasswordRetries = 3;
42 39
43 const unsigned kCredUiDefaultFlags = 40 const unsigned kCredUiDefaultFlags =
44 CREDUI_FLAGS_GENERIC_CREDENTIALS | 41 CREDUI_FLAGS_GENERIC_CREDENTIALS |
45 CREDUI_FLAGS_EXCLUDE_CERTIFICATES | 42 CREDUI_FLAGS_EXCLUDE_CERTIFICATES |
46 CREDUI_FLAGS_KEEP_USERNAME | 43 CREDUI_FLAGS_KEEP_USERNAME |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 238 }
242 } 239 }
243 240
244 // Try and obtain a friendly display name. 241 // Try and obtain a friendly display name.
245 username_length = CREDUI_MAX_USERNAME_LENGTH; 242 username_length = CREDUI_MAX_USERNAME_LENGTH;
246 if (GetUserNameEx(NameDisplay, displayname, &username_length)) 243 if (GetUserNameEx(NameDisplay, displayname, &username_length))
247 use_displayname = true; 244 use_displayname = true;
248 245
249 cui.cbSize = sizeof(CREDUI_INFO); 246 cui.cbSize = sizeof(CREDUI_INFO);
250 cui.hwndParent = NULL; 247 cui.hwndParent = NULL;
251 #if defined(USE_AURA)
252 cui.hwndParent = window->GetHost()->GetAcceleratedWidget(); 248 cui.hwndParent = window->GetHost()->GetAcceleratedWidget();
253 #else
254 cui.hwndParent = window;
255 #endif
256 249
257 cui.pszMessageText = password_prompt.c_str(); 250 cui.pszMessageText = password_prompt.c_str();
258 cui.pszCaptionText = product_name.c_str(); 251 cui.pszCaptionText = product_name.c_str();
259 252
260 cui.hbmBanner = NULL; 253 cui.hbmBanner = NULL;
261 BOOL save_password = FALSE; 254 BOOL save_password = FALSE;
262 DWORD credErr = NO_ERROR; 255 DWORD credErr = NO_ERROR;
263 256
264 do { 257 do {
265 tries++; 258 tries++;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 291 }
299 } 292 }
300 SecureZeroMemory(password, sizeof(password)); 293 SecureZeroMemory(password, sizeof(password));
301 } 294 }
302 } while (credErr == NO_ERROR && 295 } while (credErr == NO_ERROR &&
303 (retval == false && tries < kMaxPasswordRetries)); 296 (retval == false && tries < kMaxPasswordRetries));
304 return retval; 297 return retval;
305 } 298 }
306 299
307 } // namespace password_manager_util 300 } // namespace password_manager_util
OLDNEW
« no previous file with comments | « chrome/browser/metro_utils/metro_chrome_win.cc ('k') | chrome/browser/platform_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698