Chromium Code Reviews| 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_linux.h" | 5 #include "chrome/browser/shell_integration_linux.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <glib.h> | 8 #include <glib.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 #include "base/process/launch.h" | 31 #include "base/process/launch.h" |
| 32 #include "base/strings/string_number_conversions.h" | 32 #include "base/strings/string_number_conversions.h" |
| 33 #include "base/strings/string_tokenizer.h" | 33 #include "base/strings/string_tokenizer.h" |
| 34 #include "base/strings/string_util.h" | 34 #include "base/strings/string_util.h" |
| 35 #include "base/strings/utf_string_conversions.h" | 35 #include "base/strings/utf_string_conversions.h" |
| 36 #include "base/threading/thread.h" | 36 #include "base/threading/thread.h" |
| 37 #include "base/threading/thread_restrictions.h" | 37 #include "base/threading/thread_restrictions.h" |
| 38 #include "build/build_config.h" | 38 #include "build/build_config.h" |
| 39 #include "chrome/browser/web_applications/web_app.h" | 39 #include "chrome/browser/web_applications/web_app.h" |
| 40 #include "chrome/common/chrome_constants.h" | 40 #include "chrome/common/chrome_constants.h" |
| 41 #include "chrome/common/chrome_version_info.h" | |
|
Lei Zhang
2014/01/23 21:31:30
already #included 2 lines below.
Paweł Hajdan Jr.
2014/01/29 19:03:23
Done.
| |
| 41 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/chrome_version_info.h" | 43 #include "chrome/common/chrome_version_info.h" |
| 43 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
| 44 #include "grit/chrome_unscaled_resources.h" | 45 #include "grit/chrome_unscaled_resources.h" |
| 45 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 46 #include "ui/gfx/image/image_family.h" | 47 #include "ui/gfx/image/image_family.h" |
| 47 #include "url/gurl.h" | 48 #include "url/gurl.h" |
| 48 | 49 |
| 49 using content::BrowserThread; | 50 using content::BrowserThread; |
| 50 | 51 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 578 // Get the res_name component from argv[0]. | 579 // Get the res_name component from argv[0]. |
| 579 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 580 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 580 std::string class_name = command_line->GetProgram().BaseName().value(); | 581 std::string class_name = command_line->GetProgram().BaseName().value(); |
| 581 if (!class_name.empty()) | 582 if (!class_name.empty()) |
| 582 class_name[0] = base::ToUpperASCII(class_name[0]); | 583 class_name[0] = base::ToUpperASCII(class_name[0]); |
| 583 return class_name; | 584 return class_name; |
| 584 } | 585 } |
| 585 | 586 |
| 586 std::string GetDesktopName(base::Environment* env) { | 587 std::string GetDesktopName(base::Environment* env) { |
| 587 #if defined(GOOGLE_CHROME_BUILD) | 588 #if defined(GOOGLE_CHROME_BUILD) |
| 588 return "google-chrome.desktop"; | 589 chrome::VersionInfo::Channel product_channel( |
| 590 chrome::VersionInfo::GetChannel()); | |
| 591 switch (product_channel) { | |
| 592 case chrome::VersionInfo::CHANNEL_DEV: | |
| 593 return "google-chrome-unstable.desktop"; | |
| 594 case chrome::VersionInfo::CHANNEL_BETA: | |
| 595 return "google-chrome-beta.desktop"; | |
| 596 default: | |
| 597 return "google-chrome.desktop"; | |
| 598 } | |
| 589 #else // CHROMIUM_BUILD | 599 #else // CHROMIUM_BUILD |
| 590 // Allow $CHROME_DESKTOP to override the built-in value, so that development | 600 // Allow $CHROME_DESKTOP to override the built-in value, so that development |
| 591 // versions can set themselves as the default without interfering with | 601 // versions can set themselves as the default without interfering with |
| 592 // non-official, packaged versions using the built-in value. | 602 // non-official, packaged versions using the built-in value. |
| 593 std::string name; | 603 std::string name; |
| 594 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) | 604 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) |
| 595 return name; | 605 return name; |
| 596 return "chromium-browser.desktop"; | 606 return "chromium-browser.desktop"; |
| 597 #endif | 607 #endif |
| 598 } | 608 } |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1026 for (std::vector<base::FilePath>::const_iterator it = | 1036 for (std::vector<base::FilePath>::const_iterator it = |
| 1027 shortcut_filenames_app_menu.begin(); | 1037 shortcut_filenames_app_menu.begin(); |
| 1028 it != shortcut_filenames_app_menu.end(); ++it) { | 1038 it != shortcut_filenames_app_menu.end(); ++it) { |
| 1029 DeleteShortcutInApplicationsMenu(*it, | 1039 DeleteShortcutInApplicationsMenu(*it, |
| 1030 base::FilePath(kDirectoryFilename)); | 1040 base::FilePath(kDirectoryFilename)); |
| 1031 } | 1041 } |
| 1032 } | 1042 } |
| 1033 } | 1043 } |
| 1034 | 1044 |
| 1035 } // namespace ShellIntegrationLinux | 1045 } // namespace ShellIntegrationLinux |
| OLD | NEW |