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

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

Issue 23093020: Set the WM_CLASS property of X11 windows in Linux Aura build. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 4 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
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 "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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698