| 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 "components/web_modal/web_contents_modal_dialog_manager.h" | 5 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/web_modal/single_web_contents_dialog_manager.h" | 10 #include "components/web_modal/single_web_contents_dialog_manager.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 NativeWebContentsModalDialog dialog, | 46 NativeWebContentsModalDialog dialog, |
| 47 SingleWebContentsDialogManagerDelegate* delegate, | 47 SingleWebContentsDialogManagerDelegate* delegate, |
| 48 NativeManagerTracker* tracker) | 48 NativeManagerTracker* tracker) |
| 49 : delegate_(delegate), | 49 : delegate_(delegate), |
| 50 dialog_(dialog), | 50 dialog_(dialog), |
| 51 tracker_(tracker) { | 51 tracker_(tracker) { |
| 52 if (tracker_) | 52 if (tracker_) |
| 53 tracker_->SetState(NativeManagerTracker::NOT_SHOWN); | 53 tracker_->SetState(NativeManagerTracker::NOT_SHOWN); |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void Show() OVERRIDE { | 56 virtual void Show() override { |
| 57 if (tracker_) | 57 if (tracker_) |
| 58 tracker_->SetState(NativeManagerTracker::SHOWN); | 58 tracker_->SetState(NativeManagerTracker::SHOWN); |
| 59 } | 59 } |
| 60 virtual void Hide() OVERRIDE { | 60 virtual void Hide() override { |
| 61 if (tracker_) | 61 if (tracker_) |
| 62 tracker_->SetState(NativeManagerTracker::HIDDEN); | 62 tracker_->SetState(NativeManagerTracker::HIDDEN); |
| 63 } | 63 } |
| 64 virtual void Close() OVERRIDE { | 64 virtual void Close() override { |
| 65 if (tracker_) | 65 if (tracker_) |
| 66 tracker_->SetState(NativeManagerTracker::CLOSED); | 66 tracker_->SetState(NativeManagerTracker::CLOSED); |
| 67 delegate_->WillClose(dialog_); | 67 delegate_->WillClose(dialog_); |
| 68 } | 68 } |
| 69 virtual void Focus() OVERRIDE { | 69 virtual void Focus() override { |
| 70 } | 70 } |
| 71 virtual void Pulse() OVERRIDE { | 71 virtual void Pulse() override { |
| 72 } | 72 } |
| 73 virtual void HostChanged(WebContentsModalDialogHost* new_host) OVERRIDE { | 73 virtual void HostChanged(WebContentsModalDialogHost* new_host) override { |
| 74 } | 74 } |
| 75 virtual NativeWebContentsModalDialog dialog() OVERRIDE { | 75 virtual NativeWebContentsModalDialog dialog() override { |
| 76 return dialog_; | 76 return dialog_; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void StopTracking() { | 79 void StopTracking() { |
| 80 tracker_ = NULL; | 80 tracker_ = NULL; |
| 81 } | 81 } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 SingleWebContentsDialogManagerDelegate* delegate_; | 84 SingleWebContentsDialogManagerDelegate* delegate_; |
| 85 NativeWebContentsModalDialog dialog_; | 85 NativeWebContentsModalDialog dialog_; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 test_api->CloseAllDialogs(); | 371 test_api->CloseAllDialogs(); |
| 372 | 372 |
| 373 EXPECT_FALSE(delegate->web_contents_blocked()); | 373 EXPECT_FALSE(delegate->web_contents_blocked()); |
| 374 EXPECT_FALSE(manager->IsDialogActive()); | 374 EXPECT_FALSE(manager->IsDialogActive()); |
| 375 for (int i = 0; i < kWindowCount; i++) | 375 for (int i = 0; i < kWindowCount; i++) |
| 376 EXPECT_EQ(NativeManagerTracker::CLOSED, trackers[i].state_); | 376 EXPECT_EQ(NativeManagerTracker::CLOSED, trackers[i].state_); |
| 377 } | 377 } |
| 378 | 378 |
| 379 } // namespace web_modal | 379 } // namespace web_modal |
| OLD | NEW |