| 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 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include "base/memory/scoped_ptr.h" | 9 |
| 10 #include <memory> |
| 11 |
| 10 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 12 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
| 11 #import "chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h" | 13 #import "chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h" |
| 12 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 14 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 13 #include "chrome/browser/ui/tabs/tab_utils.h" | 15 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 14 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 15 | 17 |
| 16 // The loading/waiting state of the tab. | 18 // The loading/waiting state of the tab. |
| 17 enum TabLoadingState { | 19 enum TabLoadingState { |
| 18 kTabDone, | 20 kTabDone, |
| 19 kTabLoading, | 21 kTabLoading, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib | 52 NSRect originalIconFrame_; // frame of iconView_ as loaded from nib |
| 51 BOOL isIconShowing_; // last state of iconView_ in updateVisibility | 53 BOOL isIconShowing_; // last state of iconView_ in updateVisibility |
| 52 | 54 |
| 53 BOOL pinned_; | 55 BOOL pinned_; |
| 54 BOOL active_; | 56 BOOL active_; |
| 55 BOOL selected_; | 57 BOOL selected_; |
| 56 GURL url_; | 58 GURL url_; |
| 57 TabLoadingState loadingState_; | 59 TabLoadingState loadingState_; |
| 58 id<TabControllerTarget> target_; // weak, where actions are sent | 60 id<TabControllerTarget> target_; // weak, where actions are sent |
| 59 SEL action_; // selector sent when tab is selected by clicking | 61 SEL action_; // selector sent when tab is selected by clicking |
| 60 scoped_ptr<ui::SimpleMenuModel> contextMenuModel_; | 62 std::unique_ptr<ui::SimpleMenuModel> contextMenuModel_; |
| 61 scoped_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; | 63 std::unique_ptr<TabControllerInternal::MenuDelegate> contextMenuDelegate_; |
| 62 base::scoped_nsobject<MenuController> contextMenuController_; | 64 base::scoped_nsobject<MenuController> contextMenuController_; |
| 63 } | 65 } |
| 64 | 66 |
| 65 @property(assign, nonatomic) TabLoadingState loadingState; | 67 @property(assign, nonatomic) TabLoadingState loadingState; |
| 66 | 68 |
| 67 @property(assign, nonatomic) SEL action; | 69 @property(assign, nonatomic) SEL action; |
| 68 @property(assign, nonatomic) BOOL pinned; | 70 @property(assign, nonatomic) BOOL pinned; |
| 69 @property(assign, nonatomic) NSString* toolTip; | 71 @property(assign, nonatomic) NSString* toolTip; |
| 70 // Note that |-selected| will return YES if the controller is |-active|, too. | 72 // Note that |-selected| will return YES if the controller is |-active|, too. |
| 71 // |-setSelected:| affects the selection, while |-setActive:| affects the key | 73 // |-setSelected:| affects the selection, while |-setActive:| affects the key |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 @end | 127 @end |
| 126 | 128 |
| 127 @interface TabController(TestingAPI) | 129 @interface TabController(TestingAPI) |
| 128 - (int)iconCapacity; | 130 - (int)iconCapacity; |
| 129 - (BOOL)shouldShowIcon; | 131 - (BOOL)shouldShowIcon; |
| 130 - (BOOL)shouldShowAlertIndicator; | 132 - (BOOL)shouldShowAlertIndicator; |
| 131 - (BOOL)shouldShowCloseButton; | 133 - (BOOL)shouldShowCloseButton; |
| 132 @end // TabController(TestingAPI) | 134 @end // TabController(TestingAPI) |
| 133 | 135 |
| 134 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ | 136 #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_CONTROLLER_H_ |
| OLD | NEW |