OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 8 #include "base/command_line.h" |
9 // TODO(alicet): clean up dependencies on defaults.h and max tab count. | 9 // TODO(alicet): clean up dependencies on defaults.h and max tab count. |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
11 #include "chrome/browser/extensions/extension_tab_helper.h" | 11 #include "chrome/browser/extensions/extension_tab_helper.h" |
12 #include "chrome/browser/favicon/favicon_tab_helper.h" | 12 #include "chrome/browser/favicon/favicon_tab_helper.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/tabs/tab_strip_model.h" | 14 #include "chrome/browser/tabs/tab_strip_model.h" |
15 #include "chrome/browser/tabs/tab_strip_selection_model.h" | 15 #include "chrome/browser/tabs/tab_strip_selection_model.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
18 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 18 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
19 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" | 19 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" |
20 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" | 20 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
23 #include "content/browser/renderer_host/render_view_host.h" | 23 #include "content/browser/renderer_host/render_view_host.h" |
24 #include "content/browser/tab_contents/tab_contents.h" | 24 #include "content/browser/tab_contents/tab_contents.h" |
25 #include "content/browser/user_metrics.h" | 25 #include "content/browser/user_metrics.h" |
26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 27 #include "ui/views/widget/widget.h" |
27 #include "views/controls/menu/menu_item_view.h" | 28 #include "views/controls/menu/menu_item_view.h" |
28 #include "views/controls/menu/menu_model_adapter.h" | 29 #include "views/controls/menu/menu_model_adapter.h" |
29 #include "views/controls/menu/menu_runner.h" | 30 #include "views/controls/menu/menu_runner.h" |
30 #include "views/widget/widget.h" | |
31 | 31 |
32 static TabRendererData::NetworkState TabContentsNetworkState( | 32 static TabRendererData::NetworkState TabContentsNetworkState( |
33 TabContents* contents) { | 33 TabContents* contents) { |
34 if (!contents || !contents->IsLoading()) | 34 if (!contents || !contents->IsLoading()) |
35 return TabRendererData::NETWORK_STATE_NONE; | 35 return TabRendererData::NETWORK_STATE_NONE; |
36 if (contents->waiting_for_response()) | 36 if (contents->waiting_for_response()) |
37 return TabRendererData::NETWORK_STATE_WAITING; | 37 return TabRendererData::NETWORK_STATE_WAITING; |
38 return TabRendererData::NETWORK_STATE_LOADING; | 38 return TabRendererData::NETWORK_STATE_LOADING; |
39 } | 39 } |
40 | 40 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
474 void BrowserTabStripController::StopHighlightTabsForCommand( | 474 void BrowserTabStripController::StopHighlightTabsForCommand( |
475 TabStripModel::ContextMenuCommand command_id, | 475 TabStripModel::ContextMenuCommand command_id, |
476 BaseTab* tab) { | 476 BaseTab* tab) { |
477 if (command_id == TabStripModel::CommandCloseTabsToRight || | 477 if (command_id == TabStripModel::CommandCloseTabsToRight || |
478 command_id == TabStripModel::CommandCloseOtherTabs) { | 478 command_id == TabStripModel::CommandCloseOtherTabs) { |
479 // Just tell all Tabs to stop pulsing - it's safe. | 479 // Just tell all Tabs to stop pulsing - it's safe. |
480 tabstrip_->StopAllHighlighting(); | 480 tabstrip_->StopAllHighlighting(); |
481 } | 481 } |
482 } | 482 } |
OLD | NEW |