| 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 20 matching lines...) Expand all Loading... |
| 31 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
| 32 #include "ui/views/controls/label.h" | 32 #include "ui/views/controls/label.h" |
| 33 #include "ui/views/controls/link.h" | 33 #include "ui/views/controls/link.h" |
| 34 #include "ui/views/controls/menu/menu_runner.h" | 34 #include "ui/views/controls/menu/menu_runner.h" |
| 35 #include "ui/views/widget/widget.h" | 35 #include "ui/views/widget/widget.h" |
| 36 #include "ui/views/window/non_client_view.h" | 36 #include "ui/views/window/non_client_view.h" |
| 37 | 37 |
| 38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 39 #include "base/win/win_util.h" | 39 #include "base/win/win_util.h" |
| 40 #include "base/win/windows_version.h" | 40 #include "base/win/windows_version.h" |
| 41 #include "ui/base/win/hwnd_util.h" | |
| 42 #include "ui/gfx/icon_util.h" | 41 #include "ui/gfx/icon_util.h" |
| 42 #include "ui/gfx/win/hwnd_util.h" |
| 43 #endif | 43 #endif |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 const int InfoBar::kSeparatorLineHeight = | 46 const int InfoBar::kSeparatorLineHeight = |
| 47 views::NonClientFrameView::kClientEdgeThickness; | 47 views::NonClientFrameView::kClientEdgeThickness; |
| 48 const int InfoBar::kDefaultArrowTargetHeight = 9; | 48 const int InfoBar::kDefaultArrowTargetHeight = 9; |
| 49 const int InfoBar::kMaximumArrowTargetHeight = 24; | 49 const int InfoBar::kMaximumArrowTargetHeight = 24; |
| 50 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; | 50 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; |
| 51 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; | 51 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; |
| 52 const int InfoBar::kDefaultBarTargetHeight = 36; | 52 const int InfoBar::kDefaultBarTargetHeight = 36; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // false); in this case the second SetFocusManager() call will silently no-op. | 333 // false); in this case the second SetFocusManager() call will silently no-op. |
| 334 SetFocusManager(NULL); | 334 SetFocusManager(NULL); |
| 335 | 335 |
| 336 #if defined(OS_WIN) && !defined(USE_AURA) | 336 #if defined(OS_WIN) && !defined(USE_AURA) |
| 337 if (!animate) | 337 if (!animate) |
| 338 return; | 338 return; |
| 339 | 339 |
| 340 // Do not restore focus (and active state with it) if some other top-level | 340 // Do not restore focus (and active state with it) if some other top-level |
| 341 // window became active. | 341 // window became active. |
| 342 views::Widget* widget = GetWidget(); | 342 views::Widget* widget = GetWidget(); |
| 343 if (!widget || ui::DoesWindowBelongToActiveWindow(widget->GetNativeView())) | 343 if (!widget || gfx::DoesWindowBelongToActiveWindow(widget->GetNativeView())) |
| 344 FocusLastFocusedExternalView(); | 344 FocusLastFocusedExternalView(); |
| 345 #endif | 345 #endif |
| 346 } | 346 } |
| 347 | 347 |
| 348 void InfoBarView::PlatformSpecificOnHeightsRecalculated() { | 348 void InfoBarView::PlatformSpecificOnHeightsRecalculated() { |
| 349 // Ensure that notifying our container of our size change will result in a | 349 // Ensure that notifying our container of our size change will result in a |
| 350 // re-layout. | 350 // re-layout. |
| 351 InvalidateLayout(); | 351 InvalidateLayout(); |
| 352 } | 352 } |
| 353 | 353 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 367 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { | 367 void InfoBarView::OnWillChangeFocus(View* focused_before, View* focused_now) { |
| 368 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); | 368 views::ExternalFocusTracker::OnWillChangeFocus(focused_before, focused_now); |
| 369 | 369 |
| 370 // This will trigger some screen readers to read the entire contents of this | 370 // This will trigger some screen readers to read the entire contents of this |
| 371 // infobar. | 371 // infobar. |
| 372 if (focused_before && focused_now && !Contains(focused_before) && | 372 if (focused_before && focused_now && !Contains(focused_before) && |
| 373 Contains(focused_now)) { | 373 Contains(focused_now)) { |
| 374 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); | 374 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_ALERT, true); |
| 375 } | 375 } |
| 376 } | 376 } |
| OLD | NEW |