| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/jsmessage_box_handler_win.h" | 5 #include "chrome/browser/jsmessage_box_handler_win.h" |
| 6 | 6 |
| 7 #include "chrome/browser/app_modal_dialog_queue.h" | 7 #include "chrome/browser/app_modal_dialog_queue.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/tab_contents/web_contents.h" | 10 #include "chrome/browser/tab_contents/web_contents.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 dialog_->Activate(); | 167 dialog_->Activate(); |
| 168 } | 168 } |
| 169 | 169 |
| 170 /////////////////////////////////////////////////////////////////////////////// | 170 /////////////////////////////////////////////////////////////////////////////// |
| 171 // JavascriptMessageBoxHandler, views::WindowDelegate implementation: | 171 // JavascriptMessageBoxHandler, views::WindowDelegate implementation: |
| 172 | 172 |
| 173 views::View* JavascriptMessageBoxHandler::GetContentsView() { | 173 views::View* JavascriptMessageBoxHandler::GetContentsView() { |
| 174 return message_box_view_; | 174 return message_box_view_; |
| 175 } | 175 } |
| 176 | 176 |
| 177 views::View* JavascriptMessageBoxHandler::GetInitiallyFocusedView() const { | 177 views::View* JavascriptMessageBoxHandler::GetInitiallyFocusedView() { |
| 178 if (message_box_view_->text_box()) | 178 if (message_box_view_->text_box()) |
| 179 return message_box_view_->text_box(); | 179 return message_box_view_->text_box(); |
| 180 return views::AppModalDialogDelegate::GetInitiallyFocusedView(); | 180 return views::AppModalDialogDelegate::GetInitiallyFocusedView(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 /////////////////////////////////////////////////////////////////////////////// | 183 /////////////////////////////////////////////////////////////////////////////// |
| 184 // JavascriptMessageBoxHandler, private: | 184 // JavascriptMessageBoxHandler, private: |
| 185 | 185 |
| 186 void JavascriptMessageBoxHandler::Observe(NotificationType type, | 186 void JavascriptMessageBoxHandler::Observe(NotificationType type, |
| 187 const NotificationSource& source, | 187 const NotificationSource& source, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 200 web_contents_gone = true; | 200 web_contents_gone = true; |
| 201 | 201 |
| 202 if (web_contents_gone) { | 202 if (web_contents_gone) { |
| 203 web_contents_ = NULL; | 203 web_contents_ = NULL; |
| 204 | 204 |
| 205 // If the dialog is visible close it. | 205 // If the dialog is visible close it. |
| 206 if (dialog_) | 206 if (dialog_) |
| 207 dialog_->Close(); | 207 dialog_->Close(); |
| 208 } | 208 } |
| 209 } | 209 } |
| OLD | NEW |