| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2121 | 2121 |
| 2122 bool Browser::IsReservedCommand(int command_id) { | 2122 bool Browser::IsReservedCommand(int command_id) { |
| 2123 return command_id == IDC_CLOSE_TAB || | 2123 return command_id == IDC_CLOSE_TAB || |
| 2124 command_id == IDC_CLOSE_WINDOW || | 2124 command_id == IDC_CLOSE_WINDOW || |
| 2125 command_id == IDC_NEW_INCOGNITO_WINDOW || | 2125 command_id == IDC_NEW_INCOGNITO_WINDOW || |
| 2126 command_id == IDC_NEW_TAB || | 2126 command_id == IDC_NEW_TAB || |
| 2127 command_id == IDC_NEW_WINDOW || | 2127 command_id == IDC_NEW_WINDOW || |
| 2128 command_id == IDC_RESTORE_TAB || | 2128 command_id == IDC_RESTORE_TAB || |
| 2129 command_id == IDC_SELECT_NEXT_TAB || | 2129 command_id == IDC_SELECT_NEXT_TAB || |
| 2130 command_id == IDC_SELECT_PREVIOUS_TAB || | 2130 command_id == IDC_SELECT_PREVIOUS_TAB || |
| 2131 command_id == IDC_TABPOSE || |
| 2131 command_id == IDC_EXIT || | 2132 command_id == IDC_EXIT || |
| 2132 command_id == IDC_SEARCH; | 2133 command_id == IDC_SEARCH; |
| 2133 } | 2134 } |
| 2134 | 2135 |
| 2135 void Browser::SetBlockCommandExecution(bool block) { | 2136 void Browser::SetBlockCommandExecution(bool block) { |
| 2136 block_command_execution_ = block; | 2137 block_command_execution_ = block; |
| 2137 if (block) { | 2138 if (block) { |
| 2138 last_blocked_command_id_ = -1; | 2139 last_blocked_command_id_ = -1; |
| 2139 last_blocked_command_disposition_ = CURRENT_TAB; | 2140 last_blocked_command_disposition_ = CURRENT_TAB; |
| 2140 } | 2141 } |
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3204 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_PREVIOUS, normal_window); | 3205 command_updater_.UpdateCommandEnabled(IDC_MOVE_TAB_PREVIOUS, normal_window); |
| 3205 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_0, normal_window); | 3206 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_0, normal_window); |
| 3206 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_1, normal_window); | 3207 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_1, normal_window); |
| 3207 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_2, normal_window); | 3208 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_2, normal_window); |
| 3208 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_3, normal_window); | 3209 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_3, normal_window); |
| 3209 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_4, normal_window); | 3210 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_4, normal_window); |
| 3210 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_5, normal_window); | 3211 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_5, normal_window); |
| 3211 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_6, normal_window); | 3212 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_6, normal_window); |
| 3212 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_7, normal_window); | 3213 command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_7, normal_window); |
| 3213 command_updater_.UpdateCommandEnabled(IDC_SELECT_LAST_TAB, normal_window); | 3214 command_updater_.UpdateCommandEnabled(IDC_SELECT_LAST_TAB, normal_window); |
| 3215 #if defined(OS_MACOSX) |
| 3216 command_updater_.UpdateCommandEnabled(IDC_TABPOSE, normal_window); |
| 3217 #endif |
| 3214 | 3218 |
| 3215 // Page-related commands | 3219 // Page-related commands |
| 3216 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE, normal_window); | 3220 command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE, normal_window); |
| 3217 | 3221 |
| 3218 // Clipboard commands | 3222 // Clipboard commands |
| 3219 command_updater_.UpdateCommandEnabled(IDC_COPY_URL, non_devtools_window); | 3223 command_updater_.UpdateCommandEnabled(IDC_COPY_URL, non_devtools_window); |
| 3220 | 3224 |
| 3221 // Find-in-page | 3225 // Find-in-page |
| 3222 command_updater_.UpdateCommandEnabled(IDC_FIND, non_devtools_window); | 3226 command_updater_.UpdateCommandEnabled(IDC_FIND, non_devtools_window); |
| 3223 command_updater_.UpdateCommandEnabled(IDC_FIND_NEXT, non_devtools_window); | 3227 command_updater_.UpdateCommandEnabled(IDC_FIND_NEXT, non_devtools_window); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4050 } | 4054 } |
| 4051 | 4055 |
| 4052 bool Browser::IsPinned(TabContents* source) { | 4056 bool Browser::IsPinned(TabContents* source) { |
| 4053 int index = tabstrip_model_.GetIndexOfTabContents(source); | 4057 int index = tabstrip_model_.GetIndexOfTabContents(source); |
| 4054 if (index == TabStripModel::kNoTab) { | 4058 if (index == TabStripModel::kNoTab) { |
| 4055 NOTREACHED() << "IsPinned called for tab not in our strip"; | 4059 NOTREACHED() << "IsPinned called for tab not in our strip"; |
| 4056 return false; | 4060 return false; |
| 4057 } | 4061 } |
| 4058 return tabstrip_model_.IsTabPinned(index); | 4062 return tabstrip_model_.IsTabPinned(index); |
| 4059 } | 4063 } |
| OLD | NEW |