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/bubble/bubble.h" | 5 #include "chrome/browser/ui/views/bubble/bubble.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "chrome/browser/ui/views/bubble/border_contents.h" | 9 #include "chrome/browser/ui/views/bubble/border_contents.h" |
10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 GetWidget()->SetBounds(window_bounds); | 328 GetWidget()->SetBounds(window_bounds); |
329 } | 329 } |
330 | 330 |
331 #if defined(OS_WIN) | 331 #if defined(OS_WIN) |
332 void Bubble::OnActivate(UINT action, BOOL minimized, HWND window) { | 332 void Bubble::OnActivate(UINT action, BOOL minimized, HWND window) { |
333 // The popup should close when it is deactivated. | 333 // The popup should close when it is deactivated. |
334 if (action == WA_INACTIVE) { | 334 if (action == WA_INACTIVE) { |
335 GetWidget()->Close(); | 335 GetWidget()->Close(); |
336 } else if (action == WA_ACTIVE) { | 336 } else if (action == WA_ACTIVE) { |
337 DCHECK(GetWidget()->GetRootView()->has_children()); | 337 DCHECK(GetWidget()->GetRootView()->has_children()); |
338 GetWidget()->GetRootView()->GetChildViewAt(0)->RequestFocus(); | 338 GetWidget()->GetRootView()->child_at(0)->RequestFocus(); |
339 } | 339 } |
340 } | 340 } |
341 #elif defined(TOOLKIT_USES_GTK) | 341 #elif defined(TOOLKIT_USES_GTK) |
342 void Bubble::IsActiveChanged() { | 342 void Bubble::IsActiveChanged() { |
343 if (!GetWidget()->IsActive()) | 343 if (!GetWidget()->IsActive()) |
344 GetWidget()->Close(); | 344 GetWidget()->Close(); |
345 } | 345 } |
346 #endif | 346 #endif |
347 | 347 |
348 void Bubble::DoClose(bool closed_by_escape) { | 348 void Bubble::DoClose(bool closed_by_escape) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 animation_->Hide(); | 394 animation_->Hide(); |
395 } | 395 } |
396 | 396 |
397 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { | 397 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { |
398 if (!delegate_ || delegate_->CloseOnEscape()) { | 398 if (!delegate_ || delegate_->CloseOnEscape()) { |
399 DoClose(true); | 399 DoClose(true); |
400 return true; | 400 return true; |
401 } | 401 } |
402 return false; | 402 return false; |
403 } | 403 } |
OLD | NEW |