| 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 <shobjidl.h> | 8 #include <shobjidl.h> |
| 9 #include <propkey.h> | 9 #include <propkey.h> |
| 10 #include <propvarutil.h> | 10 #include <propvarutil.h> |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 MigrateWin7ShortcutsInPath(chrome_exe, path); | 388 MigrateWin7ShortcutsInPath(chrome_exe, path); |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 // Activates the application with the given AppUserModelId. | 392 // Activates the application with the given AppUserModelId. |
| 393 bool ActivateApplication(const string16& app_id) { | 393 bool ActivateApplication(const string16& app_id) { |
| 394 // Not supported when running in metro mode. | 394 // Not supported when running in metro mode. |
| 395 // TODO(grt) This should perhaps check that this Chrome isn't in metro mode | 395 // TODO(grt) This should perhaps check that this Chrome isn't in metro mode |
| 396 // or, if it is, that |app_id| doesn't identify this Chrome. | 396 // or, if it is, that |app_id| doesn't identify this Chrome. |
| 397 if (base::win::GetMetroModule()) | 397 if (base::win::IsMetroProcess()) |
| 398 return false; | 398 return false; |
| 399 | 399 |
| 400 // Delegate to metro_driver, which has the brains to invoke the activation | 400 // Delegate to metro_driver, which has the brains to invoke the activation |
| 401 // wizardry. | 401 // wizardry. |
| 402 bool success = false; | 402 bool success = false; |
| 403 const FilePath metro_driver_path(chrome::kMetroDriverDll); | 403 const FilePath metro_driver_path(chrome::kMetroDriverDll); |
| 404 base::ScopedNativeLibrary metro_driver(metro_driver_path); | 404 base::ScopedNativeLibrary metro_driver(metro_driver_path); |
| 405 if (!metro_driver.is_valid()) { | 405 if (!metro_driver.is_valid()) { |
| 406 PLOG(ERROR) << "Failed to load metro_driver."; | 406 PLOG(ERROR) << "Failed to load metro_driver."; |
| 407 } else { | 407 } else { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 BrowserThread::PostTask( | 596 BrowserThread::PostTask( |
| 597 BrowserThread::FILE, FROM_HERE, | 597 BrowserThread::FILE, FROM_HERE, |
| 598 base::Bind(&MigrateChromiumShortcutsCallback)); | 598 base::Bind(&MigrateChromiumShortcutsCallback)); |
| 599 } | 599 } |
| 600 | 600 |
| 601 bool ShellIntegration::ActivateMetroChrome() { | 601 bool ShellIntegration::ActivateMetroChrome() { |
| 602 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 602 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 603 const string16 app_id(dist->GetBrowserAppId()); | 603 const string16 app_id(dist->GetBrowserAppId()); |
| 604 return ActivateApplication(app_id); | 604 return ActivateApplication(app_id); |
| 605 } | 605 } |
| OLD | NEW |