| 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" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 new_cmd_line.AppendSwitchASCII(switches::kAppId, extension_app_id); | 101 new_cmd_line.AppendSwitchASCII(switches::kAppId, extension_app_id); |
| 102 } else { | 102 } else { |
| 103 // Use '--app=url' instead of just 'url' to launch the browser with minimal | 103 // Use '--app=url' instead of just 'url' to launch the browser with minimal |
| 104 // chrome. | 104 // chrome. |
| 105 // Note: Do not change this flag! Old Gears shortcuts will break if you do! | 105 // Note: Do not change this flag! Old Gears shortcuts will break if you do! |
| 106 new_cmd_line.AppendSwitchASCII(switches::kApp, url.spec()); | 106 new_cmd_line.AppendSwitchASCII(switches::kApp, url.spec()); |
| 107 } | 107 } |
| 108 return new_cmd_line; | 108 return new_cmd_line; |
| 109 } | 109 } |
| 110 | 110 |
| 111 std::string ShellIntegration::GetProgramClassName() { |
| 112 DCHECK(CommandLine::InitializedForCurrentProcess()); |
| 113 // Get the res_name component from argv[0]. |
| 114 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 115 std::string class_name = command_line->GetProgram().BaseName().value(); |
| 116 if (!class_name.empty()) |
| 117 class_name[0] = base::ToUpperASCII(class_name[0]); |
| 118 return class_name; |
| 119 } |
| 120 |
| 111 #if !defined(OS_WIN) | 121 #if !defined(OS_WIN) |
| 112 // static | 122 // static |
| 113 bool ShellIntegration::SetAsDefaultBrowserInteractive() { | 123 bool ShellIntegration::SetAsDefaultBrowserInteractive() { |
| 114 return false; | 124 return false; |
| 115 } | 125 } |
| 116 | 126 |
| 117 // static | 127 // static |
| 118 bool ShellIntegration::SetAsDefaultProtocolClientInteractive( | 128 bool ShellIntegration::SetAsDefaultProtocolClientInteractive( |
| 119 const std::string& protocol) { | 129 const std::string& protocol) { |
| 120 return false; | 130 return false; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 result = ShellIntegration::SetAsDefaultProtocolClientInteractive( | 306 result = ShellIntegration::SetAsDefaultProtocolClientInteractive( |
| 297 protocol_); | 307 protocol_); |
| 298 } | 308 } |
| 299 break; | 309 break; |
| 300 default: | 310 default: |
| 301 NOTREACHED(); | 311 NOTREACHED(); |
| 302 } | 312 } |
| 303 | 313 |
| 304 return result; | 314 return result; |
| 305 } | 315 } |
| OLD | NEW |