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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 | 20 |
21 bool ShellIntegration::CanSetAsDefaultProtocolClient() { | 21 ShellIntegration::DefaultSettingsChangePermission |
| 22 ShellIntegration::CanSetAsDefaultProtocolClient() { |
22 // Allowed as long as the browser can become the operating system default | 23 // Allowed as long as the browser can become the operating system default |
23 // browser. | 24 // browser. |
24 return CanSetAsDefaultBrowser(); | 25 return CanSetAsDefaultBrowser(); |
25 } | 26 } |
26 | 27 |
27 ShellIntegration::ShortcutInfo::ShortcutInfo() | 28 ShellIntegration::ShortcutInfo::ShortcutInfo() |
28 : is_platform_app(false), | 29 : is_platform_app(false), |
29 create_on_desktop(false), | 30 create_on_desktop(false), |
30 create_in_applications_menu(false), | 31 create_in_applications_menu(false), |
31 create_in_quick_launch_bar(false) { | 32 create_in_quick_launch_bar(false) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 } | 86 } |
86 } else { | 87 } else { |
87 // Use '--app=url' instead of just 'url' to launch the browser with minimal | 88 // Use '--app=url' instead of just 'url' to launch the browser with minimal |
88 // chrome. | 89 // chrome. |
89 // Note: Do not change this flag! Old Gears shortcuts will break if you do! | 90 // Note: Do not change this flag! Old Gears shortcuts will break if you do! |
90 new_cmd_line.AppendSwitchASCII(switches::kApp, url.spec()); | 91 new_cmd_line.AppendSwitchASCII(switches::kApp, url.spec()); |
91 } | 92 } |
92 return new_cmd_line; | 93 return new_cmd_line; |
93 } | 94 } |
94 | 95 |
| 96 #if !defined(OS_WIN) |
| 97 // static |
| 98 bool ShellIntegration::StartSetAsDefaultBrowserInteractive() { |
| 99 return false; |
| 100 } |
| 101 #endif |
| 102 |
95 /////////////////////////////////////////////////////////////////////////////// | 103 /////////////////////////////////////////////////////////////////////////////// |
96 // ShellIntegration::DefaultWebClientWorker | 104 // ShellIntegration::DefaultWebClientWorker |
97 // | 105 // |
98 | 106 |
99 ShellIntegration::DefaultWebClientWorker::DefaultWebClientWorker( | 107 ShellIntegration::DefaultWebClientWorker::DefaultWebClientWorker( |
100 DefaultWebClientObserver* observer) | 108 DefaultWebClientObserver* observer) |
101 : observer_(observer) { | 109 : observer_(observer) { |
102 } | 110 } |
103 | 111 |
104 void ShellIntegration::DefaultWebClientWorker::StartCheckIsDefault() { | 112 void ShellIntegration::DefaultWebClientWorker::StartCheckIsDefault() { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // DefaultProtocolClientWorker, private: | 229 // DefaultProtocolClientWorker, private: |
222 | 230 |
223 ShellIntegration::DefaultWebClientState | 231 ShellIntegration::DefaultWebClientState |
224 ShellIntegration::DefaultProtocolClientWorker::CheckIsDefault() { | 232 ShellIntegration::DefaultProtocolClientWorker::CheckIsDefault() { |
225 return ShellIntegration::IsDefaultProtocolClient(protocol_); | 233 return ShellIntegration::IsDefaultProtocolClient(protocol_); |
226 } | 234 } |
227 | 235 |
228 void ShellIntegration::DefaultProtocolClientWorker::SetAsDefault() { | 236 void ShellIntegration::DefaultProtocolClientWorker::SetAsDefault() { |
229 ShellIntegration::SetAsDefaultProtocolClient(protocol_); | 237 ShellIntegration::SetAsDefaultProtocolClient(protocol_); |
230 } | 238 } |
OLD | NEW |