| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/info_bubble.h" | 5 #include "chrome/browser/ui/views/info_bubble.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/ui/window_sizer.h" | 9 #include "chrome/browser/ui/window_sizer.h" |
| 10 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 #endif | 493 #endif |
| 494 SetBounds(window_bounds); | 494 SetBounds(window_bounds); |
| 495 } | 495 } |
| 496 | 496 |
| 497 #if defined(OS_WIN) | 497 #if defined(OS_WIN) |
| 498 void InfoBubble::OnActivate(UINT action, BOOL minimized, HWND window) { | 498 void InfoBubble::OnActivate(UINT action, BOOL minimized, HWND window) { |
| 499 // The popup should close when it is deactivated. | 499 // The popup should close when it is deactivated. |
| 500 if (action == WA_INACTIVE) { | 500 if (action == WA_INACTIVE) { |
| 501 Close(); | 501 Close(); |
| 502 } else if (action == WA_ACTIVE) { | 502 } else if (action == WA_ACTIVE) { |
| 503 DCHECK_GT(GetRootView()->GetChildViewCount(), 0); | 503 DCHECK(GetRootView()->has_children()); |
| 504 GetRootView()->GetChildViewAt(0)->RequestFocus(); | 504 GetRootView()->GetChildViewAt(0)->RequestFocus(); |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 #elif defined(OS_LINUX) | 507 #elif defined(OS_LINUX) |
| 508 void InfoBubble::IsActiveChanged() { | 508 void InfoBubble::IsActiveChanged() { |
| 509 if (!IsActive()) | 509 if (!IsActive()) |
| 510 Close(); | 510 Close(); |
| 511 } | 511 } |
| 512 #endif | 512 #endif |
| 513 | 513 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 animation_->Hide(); | 558 animation_->Hide(); |
| 559 } | 559 } |
| 560 | 560 |
| 561 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) { | 561 bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 562 if (!delegate_ || delegate_->CloseOnEscape()) { | 562 if (!delegate_ || delegate_->CloseOnEscape()) { |
| 563 DoClose(true); | 563 DoClose(true); |
| 564 return true; | 564 return true; |
| 565 } | 565 } |
| 566 return false; | 566 return false; |
| 567 } | 567 } |
| OLD | NEW |