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