| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/libgtk2ui/app_indicator_icon.h" | 5 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 app_indicator_set_icon_theme_path_func app_indicator_set_icon_theme_path = NULL; | 76 app_indicator_set_icon_theme_path_func app_indicator_set_icon_theme_path = NULL; |
| 77 | 77 |
| 78 void EnsureMethodsLoaded() { | 78 void EnsureMethodsLoaded() { |
| 79 if (g_attempted_load) | 79 if (g_attempted_load) |
| 80 return; | 80 return; |
| 81 | 81 |
| 82 g_attempted_load = true; | 82 g_attempted_load = true; |
| 83 | 83 |
| 84 void* indicator_lib = dlopen("libappindicator.so", RTLD_LAZY); | 84 void* indicator_lib = dlopen("libappindicator.so", RTLD_LAZY); |
| 85 if (!indicator_lib) { | 85 if (!indicator_lib) { |
| 86 indicator_lib = dlopen("libappindicator3.so.1", RTLD_LAZY); | |
| 87 } | |
| 88 if (!indicator_lib) { | |
| 89 indicator_lib = dlopen("libappindicator.so.1", RTLD_LAZY); | 86 indicator_lib = dlopen("libappindicator.so.1", RTLD_LAZY); |
| 90 } | 87 } |
| 91 if (!indicator_lib) { | 88 if (!indicator_lib) { |
| 92 indicator_lib = dlopen("libappindicator.so.0", RTLD_LAZY); | 89 indicator_lib = dlopen("libappindicator.so.0", RTLD_LAZY); |
| 93 } | 90 } |
| 94 if (!indicator_lib) { | 91 if (!indicator_lib) { |
| 95 return; | 92 return; |
| 96 } | 93 } |
| 97 | 94 |
| 98 g_opened = true; | 95 g_opened = true; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 int id; | 362 int id; |
| 366 if (!GetMenuItemID(menu_item, &id)) | 363 if (!GetMenuItemID(menu_item, &id)) |
| 367 return; | 364 return; |
| 368 | 365 |
| 369 // The menu item can still be activated by hotkeys even if it is disabled. | 366 // The menu item can still be activated by hotkeys even if it is disabled. |
| 370 if (menu_model_->IsEnabledAt(id)) | 367 if (menu_model_->IsEnabledAt(id)) |
| 371 ExecuteCommand(model, id); | 368 ExecuteCommand(model, id); |
| 372 } | 369 } |
| 373 | 370 |
| 374 } // namespace libgtk2ui | 371 } // namespace libgtk2ui |
| OLD | NEW |