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

Side by Side Diff: chrome/browser/shell_integration_win.cc

Issue 9863026: Allow external protocol handlers to open in Windows 8. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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) 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // Determine the app path. If we can't determine what that is, we have 366 // Determine the app path. If we can't determine what that is, we have
367 // bigger fish to fry... 367 // bigger fish to fry...
368 FilePath app_path; 368 FilePath app_path;
369 if (!PathService::Get(base::FILE_EXE, &app_path)) { 369 if (!PathService::Get(base::FILE_EXE, &app_path)) {
370 LOG(ERROR) << "Error getting app exe path"; 370 LOG(ERROR) << "Error getting app exe path";
371 return UNKNOWN_DEFAULT_WEB_CLIENT; 371 return UNKNOWN_DEFAULT_WEB_CLIENT;
372 } 372 }
373 373
374 string16 wprotocol = UTF8ToUTF16(protocol); 374 string16 wprotocol = UTF8ToUTF16(protocol);
375 375
376 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { 376 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
377 // Windows 8 has removed the ability to ask about the default handlers.
378 return UNKNOWN_DEFAULT_WEB_CLIENT;
379 } else if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
377 base::win::ScopedComPtr<IApplicationAssociationRegistration> pAAR; 380 base::win::ScopedComPtr<IApplicationAssociationRegistration> pAAR;
378 HRESULT hr = pAAR.CreateInstance(CLSID_ApplicationAssociationRegistration, 381 HRESULT hr = pAAR.CreateInstance(CLSID_ApplicationAssociationRegistration,
379 NULL, CLSCTX_INPROC); 382 NULL, CLSCTX_INPROC);
380 if (!SUCCEEDED(hr)) 383 if (!SUCCEEDED(hr))
381 return NOT_DEFAULT_WEB_CLIENT; 384 return NOT_DEFAULT_WEB_CLIENT;
382 385
383 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 386 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
384 string16 app_name = dist->GetApplicationName(); 387 string16 app_name = dist->GetApplicationName();
385 // If a user specific default browser entry exists, we check for that 388 // If a user specific default browser entry exists, we check for that
386 // app name being default. If not, then default browser is just called 389 // app name being default. If not, then default browser is just called
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 502 }
500 503
501 void ShellIntegration::MigrateChromiumShortcuts() { 504 void ShellIntegration::MigrateChromiumShortcuts() {
502 if (base::win::GetVersion() < base::win::VERSION_WIN7) 505 if (base::win::GetVersion() < base::win::VERSION_WIN7)
503 return; 506 return;
504 507
505 BrowserThread::PostTask( 508 BrowserThread::PostTask(
506 BrowserThread::FILE, FROM_HERE, 509 BrowserThread::FILE, FROM_HERE,
507 base::Bind(&MigrateChromiumShortcutsCallback)); 510 base::Bind(&MigrateChromiumShortcutsCallback));
508 } 511 }
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