OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 // Overridden from ui::SimpleMenuModel::Delegate: | 127 // Overridden from ui::SimpleMenuModel::Delegate: |
128 bool IsCommandIdChecked(int command_id) const override { return false; } | 128 bool IsCommandIdChecked(int command_id) const override { return false; } |
129 bool IsCommandIdEnabled(int command_id) const override { | 129 bool IsCommandIdEnabled(int command_id) const override { |
130 return controller_->IsCommandEnabledForTab( | 130 return controller_->IsCommandEnabledForTab( |
131 static_cast<TabStripModel::ContextMenuCommand>(command_id), | 131 static_cast<TabStripModel::ContextMenuCommand>(command_id), |
132 tab_); | 132 tab_); |
133 } | 133 } |
134 bool GetAcceleratorForCommandId(int command_id, | 134 bool GetAcceleratorForCommandId(int command_id, |
135 ui::Accelerator* accelerator) override { | 135 ui::Accelerator* accelerator) const override { |
136 int browser_cmd; | 136 int browser_cmd; |
137 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, | 137 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, |
138 &browser_cmd) ? | 138 &browser_cmd) ? |
139 controller_->tabstrip_->GetWidget()->GetAccelerator(browser_cmd, | 139 controller_->tabstrip_->GetWidget()->GetAccelerator(browser_cmd, |
140 accelerator) : | 140 accelerator) : |
141 false; | 141 false; |
142 } | 142 } |
143 void CommandIdHighlighted(int command_id) override { | 143 void CommandIdHighlighted(int command_id) override { |
144 controller_->StopHighlightTabsForCommand(last_command_, tab_); | 144 controller_->StopHighlightTabsForCommand(last_command_, tab_); |
145 last_command_ = static_cast<TabStripModel::ContextMenuCommand>(command_id); | 145 last_command_ = static_cast<TabStripModel::ContextMenuCommand>(command_id); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 content::WebPluginInfo plugin; | 571 content::WebPluginInfo plugin; |
572 tabstrip_->FileSupported( | 572 tabstrip_->FileSupported( |
573 url, | 573 url, |
574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || | 574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || |
575 content::PluginService::GetInstance()->GetPluginInfo( | 575 content::PluginService::GetInstance()->GetPluginInfo( |
576 -1, // process ID | 576 -1, // process ID |
577 MSG_ROUTING_NONE, // routing ID | 577 MSG_ROUTING_NONE, // routing ID |
578 model_->profile()->GetResourceContext(), url, GURL(), mime_type, | 578 model_->profile()->GetResourceContext(), url, GURL(), mime_type, |
579 false, NULL, &plugin, NULL)); | 579 false, NULL, &plugin, NULL)); |
580 } | 580 } |
OLD | NEW |