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 "ash/launcher/tabbed_launcher_button.h" | 5 #include "ash/launcher/tabbed_launcher_button.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
10 #include "ash/launcher/launcher_types.h" | 10 #include "ash/launcher/launcher_types.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const gfx::ImageSkia* TabbedLauncherButton::IconView::incognito_browser_image_ = | 108 const gfx::ImageSkia* TabbedLauncherButton::IconView::incognito_browser_image_ = |
109 NULL; | 109 NULL; |
110 const gfx::ImageSkia* TabbedLauncherButton::IconView::browser_panel_image_ = | 110 const gfx::ImageSkia* TabbedLauncherButton::IconView::browser_panel_image_ = |
111 NULL; | 111 NULL; |
112 const gfx::ImageSkia* | 112 const gfx::ImageSkia* |
113 TabbedLauncherButton::IconView::incognito_browser_panel_image_ = NULL; | 113 TabbedLauncherButton::IconView::incognito_browser_panel_image_ = NULL; |
114 | 114 |
115 TabbedLauncherButton* TabbedLauncherButton::Create( | 115 TabbedLauncherButton* TabbedLauncherButton::Create( |
116 views::ButtonListener* listener, | 116 views::ButtonListener* listener, |
117 LauncherButtonHost* host, | 117 LauncherButtonHost* host, |
| 118 ShelfLayoutManager* shelf_layout_manager, |
118 IncognitoState is_incognito) { | 119 IncognitoState is_incognito) { |
119 TabbedLauncherButton* button = | 120 TabbedLauncherButton* button = new TabbedLauncherButton( |
120 new TabbedLauncherButton(listener, host, is_incognito); | 121 listener, host, shelf_layout_manager, is_incognito); |
121 button->Init(); | 122 button->Init(); |
122 return button; | 123 return button; |
123 } | 124 } |
124 | 125 |
125 TabbedLauncherButton::TabbedLauncherButton(views::ButtonListener* listener, | 126 TabbedLauncherButton::TabbedLauncherButton( |
126 LauncherButtonHost* host, | 127 views::ButtonListener* listener, |
127 IncognitoState is_incognito) | 128 LauncherButtonHost* host, |
128 : LauncherButton(listener, host), | 129 ShelfLayoutManager* shelf_layout_manager, |
| 130 IncognitoState is_incognito) |
| 131 : LauncherButton(listener, host, shelf_layout_manager), |
129 is_incognito_(is_incognito) { | 132 is_incognito_(is_incognito) { |
130 set_accessibility_focusable(true); | 133 set_accessibility_focusable(true); |
131 } | 134 } |
132 | 135 |
133 TabbedLauncherButton::~TabbedLauncherButton() { | 136 TabbedLauncherButton::~TabbedLauncherButton() { |
134 } | 137 } |
135 | 138 |
136 void TabbedLauncherButton::SetTabImage(const gfx::ImageSkia& image) { | 139 void TabbedLauncherButton::SetTabImage(const gfx::ImageSkia& image) { |
137 tabbed_icon_view()->SetTabImage(image); | 140 tabbed_icon_view()->SetTabImage(image); |
138 } | 141 } |
139 | 142 |
140 void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { | 143 void TabbedLauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { |
141 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; | 144 state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON; |
142 state->name = host()->GetAccessibleName(this); | 145 state->name = host()->GetAccessibleName(this); |
143 } | 146 } |
144 | 147 |
145 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { | 148 LauncherButton::IconView* TabbedLauncherButton::CreateIconView() { |
146 return new IconView(this); | 149 return new IconView(this); |
147 } | 150 } |
148 | 151 |
149 } // namespace internal | 152 } // namespace internal |
150 } // namespace ash | 153 } // namespace ash |
OLD | NEW |