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