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

Side by Side Diff: chrome_frame/utils.cc

Issue 6091006: Use FilePath::BaseName instead of the deprecated file_util::GetFilenameFromPath. Part 2. (Closed)
Patch Set: Created 9 years, 12 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 | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_frame/utils.h" 5 #include "chrome_frame/utils.h"
6 6
7 #include <htiframe.h> 7 #include <htiframe.h>
8 #include <mshtml.h> 8 #include <mshtml.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return browser_type; 408 return browser_type;
409 } 409 }
410 410
411 uint32 GetIEMajorVersion() { 411 uint32 GetIEMajorVersion() {
412 static uint32 ie_major_version = UINT_MAX; 412 static uint32 ie_major_version = UINT_MAX;
413 413
414 if (ie_major_version == UINT_MAX) { 414 if (ie_major_version == UINT_MAX) {
415 wchar_t exe_path[MAX_PATH]; 415 wchar_t exe_path[MAX_PATH];
416 HMODULE mod = GetModuleHandle(NULL); 416 HMODULE mod = GetModuleHandle(NULL);
417 GetModuleFileName(mod, exe_path, arraysize(exe_path) - 1); 417 GetModuleFileName(mod, exe_path, arraysize(exe_path) - 1);
418 std::wstring exe_name(file_util::GetFilenameFromPath(exe_path)); 418 std::wstring exe_name = FilePath(exe_path).BaseName().ToWStringHack();
evanm 2010/12/23 18:13:33 Since this is Windows-specific code, could you use
tfarina 2010/12/23 18:27:00 Done.
419 if (!LowerCaseEqualsASCII(exe_name, kIEImageName)) { 419 if (!LowerCaseEqualsASCII(exe_name, kIEImageName)) {
420 ie_major_version = 0; 420 ie_major_version = 0;
421 } else { 421 } else {
422 uint32 high = 0; 422 uint32 high = 0;
423 uint32 low = 0; 423 uint32 low = 0;
424 if (GetModuleVersion(mod, &high, &low)) { 424 if (GetModuleVersion(mod, &high, &low)) {
425 ie_major_version = HIWORD(high); 425 ie_major_version = HIWORD(high);
426 } else { 426 } else {
427 ie_major_version = 0; 427 ie_major_version = 0;
428 } 428 }
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 ++url_list; 1565 ++url_list;
1566 } 1566 }
1567 } 1567 }
1568 1568
1569 std::wstring GetCurrentModuleVersion() { 1569 std::wstring GetCurrentModuleVersion() {
1570 scoped_ptr<FileVersionInfo> module_version_info( 1570 scoped_ptr<FileVersionInfo> module_version_info(
1571 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); 1571 FileVersionInfo::CreateFileVersionInfoForCurrentModule());
1572 DCHECK(module_version_info.get() != NULL); 1572 DCHECK(module_version_info.get() != NULL);
1573 return module_version_info->file_version(); 1573 return module_version_info->file_version();
1574 } 1574 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698