| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <shlobj.h> | 5 #include <shlobj.h> |
| 6 | 6 |
| 7 #include "chrome_frame/html_utils.h" | 7 #include "chrome_frame/html_utils.h" |
| 8 #include "chrome_frame/utils.h" | 8 #include "chrome_frame/utils.h" |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/registry.h" | 14 #include "base/registry.h" |
| 15 #include "base/scoped_comptr_win.h" | 15 #include "base/scoped_comptr_win.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "chrome/common/chrome_constants.h" | |
| 18 #include "chrome/installer/util/google_update_constants.h" | |
| 19 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 20 #include "grit/chrome_frame_resources.h" | 18 #include "grit/chrome_frame_resources.h" |
| 21 #include "chrome_frame/resource.h" | 19 #include "chrome_frame/resource.h" |
| 22 | 20 |
| 23 // Note that these values are all lower case and are compared to | 21 // Note that these values are all lower case and are compared to |
| 24 // lower-case-transformed values. | 22 // lower-case-transformed values. |
| 25 const wchar_t kMetaTag[] = L"meta"; | 23 const wchar_t kMetaTag[] = L"meta"; |
| 26 const wchar_t kHttpEquivAttribName[] = L"http-equiv"; | 24 const wchar_t kHttpEquivAttribName[] = L"http-equiv"; |
| 27 const wchar_t kContentAttribName[] = L"content"; | 25 const wchar_t kContentAttribName[] = L"content"; |
| 28 const wchar_t kXUACompatValue[] = L"x-ua-compatible"; | 26 const wchar_t kXUACompatValue[] = L"x-ua-compatible"; |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 return true; | 539 return true; |
| 542 | 540 |
| 543 if (is_privileged && crack_url.SchemeIs("chrome-extension")) | 541 if (is_privileged && crack_url.SchemeIs("chrome-extension")) |
| 544 return true; | 542 return true; |
| 545 | 543 |
| 546 if (StartsWith(url, kChromeAttachExternalTabPrefix, false)) | 544 if (StartsWith(url, kChromeAttachExternalTabPrefix, false)) |
| 547 return true; | 545 return true; |
| 548 | 546 |
| 549 return false; | 547 return false; |
| 550 } | 548 } |
| 551 | |
| 552 // TODO(robertshield): Register and use Chrome's PathProviders. | |
| 553 // - Note that this function is used by unit tests as well to override | |
| 554 // PathService paths, so please test when addressing todo. | |
| 555 bool GetUserProfileBaseDirectory(std::wstring* path) { | |
| 556 DCHECK(path); | |
| 557 wchar_t path_buffer[MAX_PATH * 4]; | |
| 558 path_buffer[0] = 0; | |
| 559 // TODO(robertshield): Ideally we should use SHGetFolderLocation and then | |
| 560 // get a path via PIDL. | |
| 561 HRESULT hr = SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, | |
| 562 SHGFP_TYPE_CURRENT, path_buffer); | |
| 563 | |
| 564 if (SUCCEEDED(hr)) { | |
| 565 *path = path_buffer; | |
| 566 #if defined(GOOGLE_CHROME_BUILD) | |
| 567 file_util::AppendToPath(path, FILE_PATH_LITERAL("Google")); | |
| 568 #endif | |
| 569 file_util::AppendToPath(path, chrome::kBrowserAppName); | |
| 570 file_util::AppendToPath(path, chrome::kUserDataDirname); | |
| 571 return true; | |
| 572 } | |
| 573 | |
| 574 return false; | |
| 575 } | |
| OLD | NEW |