OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/repost_form_warning_controller.h" | 5 #include "chrome/browser/repost_form_warning_controller.h" |
6 | 6 |
7 #include "chrome/browser/tab_contents/tab_contents.h" | 7 #include "chrome/browser/tab_contents/tab_contents.h" |
8 #include "chrome/common/notification_service.h" | 8 #include "chrome/common/notification_source.h" |
9 | 9 |
10 RepostFormWarningController::RepostFormWarningController( | 10 RepostFormWarningController::RepostFormWarningController( |
11 TabContents* tab_contents) | 11 TabContents* tab_contents) |
12 : tab_contents_(tab_contents), | 12 : tab_contents_(tab_contents), |
13 window_(NULL) { | 13 window_(NULL) { |
14 NavigationController* controller = &tab_contents->controller(); | 14 NavigationController* controller = &tab_contents->controller(); |
15 registrar_.Add(this, NotificationType::LOAD_START, | 15 registrar_.Add(this, NotificationType::LOAD_START, |
16 Source<NavigationController>(controller)); | 16 Source<NavigationController>(controller)); |
17 registrar_.Add(this, NotificationType::TAB_CLOSING, | 17 registrar_.Add(this, NotificationType::TAB_CLOSING, |
18 Source<NavigationController>(controller)); | 18 Source<NavigationController>(controller)); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 void RepostFormWarningController::CloseDialog() { | 66 void RepostFormWarningController::CloseDialog() { |
67 // Make sure we won't do anything when |Cancel()| is called again. | 67 // Make sure we won't do anything when |Cancel()| is called again. |
68 tab_contents_ = NULL; | 68 tab_contents_ = NULL; |
69 if (window_) { | 69 if (window_) { |
70 window_->CloseConstrainedWindow(); | 70 window_->CloseConstrainedWindow(); |
71 } | 71 } |
72 } | 72 } |
OLD | NEW |