| 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 #endif | 378 #endif |
| 379 | 379 |
| 380 void Bubble::DoClose(bool closed_by_escape) { | 380 void Bubble::DoClose(bool closed_by_escape) { |
| 381 if (show_status_ == kClosed) | 381 if (show_status_ == kClosed) |
| 382 return; | 382 return; |
| 383 | 383 |
| 384 if (accelerator_registered_) | 384 if (accelerator_registered_) |
| 385 UnregisterEscapeAccelerator(); | 385 UnregisterEscapeAccelerator(); |
| 386 if (delegate_) | 386 if (delegate_) |
| 387 delegate_->BubbleClosing(this, closed_by_escape); | 387 delegate_->BubbleClosing(this, closed_by_escape); |
| 388 FOR_EACH_OBSERVER(Observer, observer_list_, OnBubbleClosing()); |
| 388 show_status_ = kClosed; | 389 show_status_ = kClosed; |
| 389 #if defined(USE_AURA) | 390 #if defined(USE_AURA) |
| 390 // TODO(beng): | 391 // TODO(beng): |
| 391 NOTIMPLEMENTED(); | 392 NOTIMPLEMENTED(); |
| 392 #elif defined(OS_WIN) | 393 #elif defined(OS_WIN) |
| 393 border_->Close(); | 394 border_->Close(); |
| 394 #endif | 395 #endif |
| 395 #if defined(USE_AURA) | 396 #if defined(USE_AURA) |
| 396 // TODO(beng): | 397 // TODO(beng): |
| 397 NOTIMPLEMENTED(); | 398 NOTIMPLEMENTED(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 animation_->Hide(); | 437 animation_->Hide(); |
| 437 } | 438 } |
| 438 | 439 |
| 439 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { | 440 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { |
| 440 if (!delegate_ || delegate_->CloseOnEscape()) { | 441 if (!delegate_ || delegate_->CloseOnEscape()) { |
| 441 DoClose(true); | 442 DoClose(true); |
| 442 return true; | 443 return true; |
| 443 } | 444 } |
| 444 return false; | 445 return false; |
| 445 } | 446 } |
| OLD | NEW |