| 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) { |
| 86 indicator_lib = dlopen("libappindicator.so.1", RTLD_LAZY); | 89 indicator_lib = dlopen("libappindicator.so.1", RTLD_LAZY); |
| 87 } | 90 } |
| 88 if (!indicator_lib) { | 91 if (!indicator_lib) { |
| 89 indicator_lib = dlopen("libappindicator.so.0", RTLD_LAZY); | 92 indicator_lib = dlopen("libappindicator.so.0", RTLD_LAZY); |
| 90 } | 93 } |
| 91 if (!indicator_lib) { | 94 if (!indicator_lib) { |
| 92 return; | 95 return; |
| 93 } | 96 } |
| 94 | 97 |
| 95 g_opened = true; | 98 g_opened = true; |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 int id; | 365 int id; |
| 363 if (!GetMenuItemID(menu_item, &id)) | 366 if (!GetMenuItemID(menu_item, &id)) |
| 364 return; | 367 return; |
| 365 | 368 |
| 366 // The menu item can still be activated by hotkeys even if it is disabled. | 369 // The menu item can still be activated by hotkeys even if it is disabled. |
| 367 if (menu_model_->IsEnabledAt(id)) | 370 if (menu_model_->IsEnabledAt(id)) |
| 368 ExecuteCommand(model, id); | 371 ExecuteCommand(model, id); |
| 369 } | 372 } |
| 370 | 373 |
| 371 } // namespace libgtk2ui | 374 } // namespace libgtk2ui |
| OLD | NEW |