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/views/tabs/tab.h" | 5 #include "chrome/browser/views/tabs/tab.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/menus/simple_menu_model.h" | 8 #include "app/menus/simple_menu_model.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return true; | 189 return true; |
190 } | 190 } |
191 | 191 |
192 bool Tab::GetAccessibleRole(AccessibilityTypes::Role* role) { | 192 bool Tab::GetAccessibleRole(AccessibilityTypes::Role* role) { |
193 DCHECK(role); | 193 DCHECK(role); |
194 | 194 |
195 *role = AccessibilityTypes::ROLE_PAGETAB; | 195 *role = AccessibilityTypes::ROLE_PAGETAB; |
196 return true; | 196 return true; |
197 } | 197 } |
198 | 198 |
199 bool Tab::GetAccessibleName(std::wstring* name) { | |
200 *name = GetTitle(); | |
201 return !name->empty(); | |
202 } | |
203 | |
204 /////////////////////////////////////////////////////////////////////////////// | 199 /////////////////////////////////////////////////////////////////////////////// |
205 // Tab, views::ContextMenuController implementation: | 200 // Tab, views::ContextMenuController implementation: |
206 | 201 |
207 void Tab::ShowContextMenu(views::View* source, | 202 void Tab::ShowContextMenu(views::View* source, |
208 const gfx::Point& p, | 203 const gfx::Point& p, |
209 bool is_mouse_gesture) { | 204 bool is_mouse_gesture) { |
210 if (!context_menu_contents_.get()) | 205 if (!context_menu_contents_.get()) |
211 context_menu_contents_.reset(new TabContextMenuContents(this)); | 206 context_menu_contents_.reset(new TabContextMenuContents(this)); |
212 context_menu_contents_->RunMenuAt(p); | 207 context_menu_contents_->RunMenuAt(p); |
213 } | 208 } |
(...skipping 27 matching lines...) Expand all Loading... |
241 | 236 |
242 // Right end cap. | 237 // Right end cap. |
243 path->lineTo(w - kTabCapWidth + kTabTopCurveWidth, kTabTopCurveWidth); | 238 path->lineTo(w - kTabCapWidth + kTabTopCurveWidth, kTabTopCurveWidth); |
244 path->lineTo(w - kTabBottomCurveWidth, h - kTabBottomCurveWidth); | 239 path->lineTo(w - kTabBottomCurveWidth, h - kTabBottomCurveWidth); |
245 path->lineTo(w, h); | 240 path->lineTo(w, h); |
246 | 241 |
247 // Close out the path. | 242 // Close out the path. |
248 path->lineTo(0, h); | 243 path->lineTo(0, h); |
249 path->close(); | 244 path->close(); |
250 } | 245 } |
OLD | NEW |