| 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/infobars/infobar_view.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_view.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 const infobars::InfoBarContainer::Delegate* InfoBarView::container_delegate() | 365 const infobars::InfoBarContainer::Delegate* InfoBarView::container_delegate() |
| 366 const { | 366 const { |
| 367 const infobars::InfoBarContainer* infobar_container = container(); | 367 const infobars::InfoBarContainer* infobar_container = container(); |
| 368 return infobar_container ? infobar_container->delegate() : NULL; | 368 return infobar_container ? infobar_container->delegate() : NULL; |
| 369 } | 369 } |
| 370 | 370 |
| 371 void InfoBarView::RunMenuAt(ui::MenuModel* menu_model, | 371 void InfoBarView::RunMenuAt(ui::MenuModel* menu_model, |
| 372 views::MenuButton* button, | 372 views::MenuButton* button, |
| 373 views::MenuItemView::AnchorPosition anchor) { | 373 ui::MenuAnchorPosition anchor) { |
| 374 DCHECK(owner()); // We'd better not open any menus while we're closing. | 374 DCHECK(owner()); // We'd better not open any menus while we're closing. |
| 375 gfx::Point screen_point; | 375 gfx::Point screen_point; |
| 376 views::View::ConvertPointToScreen(button, &screen_point); | 376 views::View::ConvertPointToScreen(button, &screen_point); |
| 377 menu_runner_.reset(new views::MenuRunner(menu_model)); | 377 menu_runner_.reset(new views::MenuRunner(menu_model)); |
| 378 // Ignore the result since we don't need to handle a deleted menu specially. | 378 // Ignore the result since we don't need to handle a deleted menu specially. |
| 379 ignore_result(menu_runner_->RunMenuAt( | 379 ignore_result(menu_runner_->RunMenuAt( |
| 380 GetWidget(), button, gfx::Rect(screen_point, button->size()), anchor, | 380 GetWidget(), button, gfx::Rect(screen_point, button->size()), anchor, |
| 381 ui::MENU_SOURCE_NONE, views::MenuRunner::HAS_MNEMONICS)); | 381 ui::MENU_SOURCE_NONE, views::MenuRunner::HAS_MNEMONICS)); |
| 382 } | 382 } |
| 383 | 383 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { | 449 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { |
| 450 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); | 450 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); |
| 451 | 451 |
| 452 // This will trigger some screen readers to read the entire contents of this | 452 // This will trigger some screen readers to read the entire contents of this |
| 453 // infobar. | 453 // infobar. |
| 454 if (focused_before && focused_now && !Contains(focused_before) && | 454 if (focused_before && focused_now && !Contains(focused_before) && |
| 455 Contains(focused_now)) { | 455 Contains(focused_now)) { |
| 456 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 456 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 457 } | 457 } |
| 458 } | 458 } |
| OLD | NEW |