Lines Matching refs:command_id

86 bool IsTabModelCommandId(int command_id) {
87 return ((command_id >= kFirstLocalTabCommandId &&
88 command_id < kFirstLocalWindowCommandId) ||
89 (command_id >= kFirstOtherDevicesTabCommandId &&
90 command_id < kMinDeviceNameCommandId));
94 bool IsWindowModelCommandId(int command_id) {
95 return command_id >= kFirstLocalWindowCommandId &&
96 command_id < kFirstOtherDevicesTabCommandId;
99 bool IsDeviceNameCommandId(int command_id) {
100 return command_id >= kMinDeviceNameCommandId &&
101 command_id <= kMaxDeviceNameCommandId;
107 int command_id = tab_vector_index + first_command_id;
108 DCHECK(IsTabModelCommandId(command_id));
109 return command_id;
114 int command_id = window_vector_index + kFirstLocalWindowCommandId;
115 DCHECK(IsWindowModelCommandId(command_id));
116 return command_id;
119 // Convert |command_id| of menu item to index in |local_window_items_|.
120 int CommandIdToWindowVectorIndex(int command_id) {
121 DCHECK(IsWindowModelCommandId(command_id));
122 return command_id - kFirstLocalWindowCommandId;
221 bool RecentTabsSubMenuModel::IsCommandIdChecked(int command_id) const {
225 bool RecentTabsSubMenuModel::IsCommandIdEnabled(int command_id) const {
226 if (command_id == kRecentlyClosedHeaderCommandId ||
227 command_id == kDisabledRecentlyClosedHeaderCommandId ||
228 command_id == IDC_RECENT_TABS_NO_DEVICE_TABS ||
229 IsDeviceNameCommandId(command_id)) {
236 int command_id, ui::Accelerator* accelerator) {
239 int index_in_menu = GetIndexOfCommandId(command_id);
241 if ((command_id == kDisabledRecentlyClosedHeaderCommandId ||
250 void RecentTabsSubMenuModel::ExecuteCommand(int command_id, int event_flags) {
251 if (command_id == IDC_SHOW_HISTORY) {
260 DCHECK_NE(IDC_RECENT_TABS_NO_DEVICE_TABS, command_id);
261 DCHECK(!IsDeviceNameCommandId(command_id));
273 if (IsTabModelCommandId(command_id)) {
275 int tab_items_idx = CommandIdToTabVectorIndex(command_id, &tab_items);
302 DCHECK(IsWindowModelCommandId(command_id));
304 int window_items_idx = CommandIdToWindowVectorIndex(command_id);
321 int command_id = GetCommandIdAt(index);
322 if (command_id == kRecentlyClosedHeaderCommandId ||
323 IsDeviceNameCommandId(command_id)) {
331 int command_id = GetCommandIdAt(item_index);
332 if (command_id == IDC_RECENT_TABS_NO_DEVICE_TABS ||
333 command_id == kRecentlyClosedHeaderCommandId ||
334 command_id == kDisabledRecentlyClosedHeaderCommandId) {
344 int command_id = GetCommandIdAt(index);
345 if (IsTabModelCommandId(command_id)) {
347 int tab_items_idx = CommandIdToTabVectorIndex(command_id, &tab_items);
483 int command_id = kMinDeviceNameCommandId + i;
484 DCHECK_LE(command_id, kMaxDeviceNameCommandId);
485 AddItem(command_id, base::UTF8ToUTF16(session->session_name));
510 int command_id = TabVectorIndexToCommandId(
514 InsertItemAt(curr_model_index, command_id,
516 AddTabFavicon(command_id, item.url);
524 int command_id = WindowVectorIndexToCommandId(local_window_items_.size());
527 InsertItemWithStringIdAt(curr_model_index, command_id,
530 InsertItemAt(curr_model_index, command_id, l10n_util::GetStringFUTF16(
547 int command_id = TabVectorIndexToCommandId(
552 AddItem(command_id,
555 AddTabFavicon(command_id, item.url);
586 void RecentTabsSubMenuModel::AddTabFavicon(int command_id, const GURL& url) {
587 bool is_local_tab = command_id < kFirstOtherDevicesTabCommandId;
588 int index_in_menu = GetIndexOfCommandId(command_id);
619 command_id),
625 int command_id,
629 int index_in_menu = GetIndexOfCommandId(command_id);
638 int command_id,
640 DCHECK(IsTabModelCommandId(command_id));
641 if (command_id >= kFirstOtherDevicesTabCommandId) {
643 return command_id - kFirstOtherDevicesTabCommandId;
646 return command_id - kFirstLocalTabCommandId;