OLD | NEW |
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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlwapi.h> | 8 #include <shlwapi.h> |
9 #include <shobjidl.h> | 9 #include <shobjidl.h> |
10 #include <propkey.h> // Needs to come after shobjidl.h. | 10 #include <propkey.h> // Needs to come after shobjidl.h. |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 NOTREACHED(); | 576 NOTREACHED(); |
577 continue; | 577 continue; |
578 } | 578 } |
579 } | 579 } |
580 | 580 |
581 // Only set dual mode if the expected app id is the default app id. | 581 // Only set dual mode if the expected app id is the default app id. |
582 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 582 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
583 base::string16 default_chromium_model_id( | 583 base::string16 default_chromium_model_id( |
584 ShellUtil::GetBrowserModelId(dist, is_per_user_install)); | 584 ShellUtil::GetBrowserModelId(dist, is_per_user_install)); |
585 if (check_dual_mode && expected_app_id == default_chromium_model_id) { | 585 if (check_dual_mode && expected_app_id == default_chromium_model_id) { |
586 const bool dual_mode_desired = | 586 // TODO(scottmg): Simplify with no Metro: http://crbug.com/558054. |
587 InstallUtil::ShouldInstallMetroProperties(); | 587 const bool dual_mode_desired = false; |
588 propvariant.Reset(); | 588 propvariant.Reset(); |
589 if (property_store->GetValue(PKEY_AppUserModel_IsDualMode, | 589 if (property_store->GetValue(PKEY_AppUserModel_IsDualMode, |
590 propvariant.Receive()) != S_OK) { | 590 propvariant.Receive()) != S_OK) { |
591 // When in doubt, prefer to not update the shortcut. | 591 // When in doubt, prefer to not update the shortcut. |
592 NOTREACHED(); | 592 NOTREACHED(); |
593 continue; | 593 continue; |
594 } else { | 594 } else { |
595 switch (propvariant.get().vt) { | 595 switch (propvariant.get().vt) { |
596 case VT_EMPTY: | 596 case VT_EMPTY: |
597 // If dual_mode is not set at all, make sure it gets set to true if | 597 // If dual_mode is not set at all, make sure it gets set to true if |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 // in the "How would you like to open this?" prompt. | 719 // in the "How would you like to open this?" prompt. |
720 if (!RegisterBrowser()) | 720 if (!RegisterBrowser()) |
721 return false; | 721 return false; |
722 | 722 |
723 ResetDefaultBrowser(); | 723 ResetDefaultBrowser(); |
724 | 724 |
725 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); | 725 base::CommandLine cmdline(base::FilePath(L"openwith.exe")); |
726 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); | 726 cmdline.AppendArgNative(StartupBrowserCreator::GetDefaultBrowserUrl()); |
727 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); | 727 return base::LaunchProcess(cmdline, base::LaunchOptions()).IsValid(); |
728 } | 728 } |
OLD | NEW |