| 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 "chrome/browser/ui/views/extensions/extension_dialog.h" | 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/extensions/extension_view_host.h" | 8 #include "chrome/browser/extensions/extension_view_host.h" |
| 9 #include "chrome/browser/extensions/extension_view_host_factory.h" | 9 #include "chrome/browser/extensions/extension_view_host_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser_dialogs.h" |
| 11 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" | 12 #include "chrome/browser/ui/views/extensions/extension_dialog_observer.h" |
| 12 #include "chrome/browser/ui/views/extensions/extension_view_views.h" | 13 #include "chrome/browser/ui/views/extensions/extension_view_views.h" |
| 13 #include "components/constrained_window/constrained_window_views.h" | 14 #include "components/constrained_window/constrained_window_views.h" |
| 14 #include "content/public/browser/notification_details.h" | 15 #include "content/public/browser/notification_details.h" |
| 15 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 16 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
| 17 #include "content/public/browser/render_widget_host.h" | 18 #include "content/public/browser/render_widget_host.h" |
| 18 #include "content/public/browser/render_widget_host_view.h" | 19 #include "content/public/browser/render_widget_host_view.h" |
| 19 #include "content/public/browser/web_contents.h" | 20 #include "content/public/browser/web_contents.h" |
| 20 #include "ui/base/base_window.h" | 21 #include "ui/base/base_window.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 45 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, | 46 extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD, |
| 46 content::Source<BrowserContext>(host->browser_context())); | 47 content::Source<BrowserContext>(host->browser_context())); |
| 47 // Listen for the containing view calling window.close(); | 48 // Listen for the containing view calling window.close(); |
| 48 registrar_.Add(this, | 49 registrar_.Add(this, |
| 49 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, | 50 extensions::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, |
| 50 content::Source<BrowserContext>(host->browser_context())); | 51 content::Source<BrowserContext>(host->browser_context())); |
| 51 // Listen for a crash or other termination of the extension process. | 52 // Listen for a crash or other termination of the extension process. |
| 52 registrar_.Add(this, | 53 registrar_.Add(this, |
| 53 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 54 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 54 content::Source<BrowserContext>(host->browser_context())); | 55 content::Source<BrowserContext>(host->browser_context())); |
| 56 chrome::RecordDialogCreation(chrome::DialogIdentifier::EXTENSION); |
| 55 } | 57 } |
| 56 | 58 |
| 57 ExtensionDialog::~ExtensionDialog() { | 59 ExtensionDialog::~ExtensionDialog() { |
| 58 } | 60 } |
| 59 | 61 |
| 60 // static | 62 // static |
| 61 ExtensionDialog* ExtensionDialog::Show( | 63 ExtensionDialog* ExtensionDialog::Show( |
| 62 const GURL& url, | 64 const GURL& url, |
| 63 gfx::NativeWindow parent_window, | 65 gfx::NativeWindow parent_window, |
| 64 Profile* profile, | 66 Profile* profile, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (content::Details<extensions::ExtensionHost>(host()) != details) | 225 if (content::Details<extensions::ExtensionHost>(host()) != details) |
| 224 return; | 226 return; |
| 225 if (observer_) | 227 if (observer_) |
| 226 observer_->ExtensionTerminated(this); | 228 observer_->ExtensionTerminated(this); |
| 227 break; | 229 break; |
| 228 default: | 230 default: |
| 229 NOTREACHED() << "Received unexpected notification"; | 231 NOTREACHED() << "Received unexpected notification"; |
| 230 break; | 232 break; |
| 231 } | 233 } |
| 232 } | 234 } |
| OLD | NEW |