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/views/frame/global_menu_bar_x11.h" | 5 #include "chrome/browser/ui/views/frame/global_menu_bar_x11.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <glib-object.h> | 8 #include <glib-object.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 // item since that happens in a different process. | 846 // item since that happens in a different process. |
847 HistoryItem* item = reinterpret_cast<HistoryItem*>( | 847 HistoryItem* item = reinterpret_cast<HistoryItem*>( |
848 g_object_get_data(G_OBJECT(sender), kHistoryItem)); | 848 g_object_get_data(G_OBJECT(sender), kHistoryItem)); |
849 | 849 |
850 // If this item can be restored using TabRestoreService, do so. Otherwise, | 850 // If this item can be restored using TabRestoreService, do so. Otherwise, |
851 // just load the URL. | 851 // just load the URL. |
852 sessions::TabRestoreService* service = | 852 sessions::TabRestoreService* service = |
853 TabRestoreServiceFactory::GetForProfile(profile_); | 853 TabRestoreServiceFactory::GetForProfile(profile_); |
854 if (item->session_id && service) { | 854 if (item->session_id && service) { |
855 service->RestoreEntryById(browser_->live_tab_context(), item->session_id, | 855 service->RestoreEntryById(browser_->live_tab_context(), item->session_id, |
856 browser_->host_desktop_type(), UNKNOWN); | 856 UNKNOWN); |
857 } else { | 857 } else { |
858 DCHECK(item->url.is_valid()); | 858 DCHECK(item->url.is_valid()); |
859 browser_->OpenURL(content::OpenURLParams( | 859 browser_->OpenURL(content::OpenURLParams( |
860 item->url, | 860 item->url, |
861 content::Referrer(), | 861 content::Referrer(), |
862 NEW_FOREGROUND_TAB, | 862 NEW_FOREGROUND_TAB, |
863 ui::PAGE_TRANSITION_AUTO_BOOKMARK, | 863 ui::PAGE_TRANSITION_AUTO_BOOKMARK, |
864 false)); | 864 false)); |
865 } | 865 } |
866 } | 866 } |
(...skipping 23 matching lines...) Expand all Loading... |
890 unsigned int timestamp) { | 890 unsigned int timestamp) { |
891 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), kProfileId)); | 891 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), kProfileId)); |
892 avatar_menu_->EditProfile(id); | 892 avatar_menu_->EditProfile(id); |
893 } | 893 } |
894 | 894 |
895 void GlobalMenuBarX11::OnCreateProfileItemActivated(DbusmenuMenuitem* sender, | 895 void GlobalMenuBarX11::OnCreateProfileItemActivated(DbusmenuMenuitem* sender, |
896 unsigned int timestamp) { | 896 unsigned int timestamp) { |
897 profiles::CreateAndSwitchToNewProfile(ProfileManager::CreateCallback(), | 897 profiles::CreateAndSwitchToNewProfile(ProfileManager::CreateCallback(), |
898 ProfileMetrics::ADD_NEW_USER_MENU); | 898 ProfileMetrics::ADD_NEW_USER_MENU); |
899 } | 899 } |
OLD | NEW |