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/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/base_window.h" | 11 #include "chrome/browser/ui/base_window.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/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
13 #include "content/public/browser/notification_details.h" | 14 #include "content/public/browser/notification_details.h" |
14 #include "content/public/browser/notification_source.h" | 15 #include "content/public/browser/notification_source.h" |
15 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
16 #include "content/public/browser/render_widget_host_view.h" | 17 #include "content/public/browser/render_widget_host_view.h" |
17 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts. | 111 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts. |
111 host->host_contents()->Focus(); | 112 host->host_contents()->Focus(); |
112 return dialog; | 113 return dialog; |
113 } | 114 } |
114 | 115 |
115 // static | 116 // static |
116 extensions::ExtensionHost* ExtensionDialog::CreateExtensionHost( | 117 extensions::ExtensionHost* ExtensionDialog::CreateExtensionHost( |
117 const GURL& url, | 118 const GURL& url, |
118 Profile* profile) { | 119 Profile* profile) { |
119 DCHECK(profile); | 120 DCHECK(profile); |
120 ExtensionProcessManager* manager = profile->GetExtensionProcessManager(); | 121 ExtensionProcessManager* manager = |
| 122 extensions::ExtensionSystem::Get(profile)->process_manager(); |
121 | 123 |
122 DCHECK(manager); | 124 DCHECK(manager); |
123 if (!manager) | 125 if (!manager) |
124 return NULL; | 126 return NULL; |
125 return manager->CreateDialogHost(url); | 127 return manager->CreateDialogHost(url); |
126 } | 128 } |
127 | 129 |
128 #if defined(USE_ASH) | 130 #if defined(USE_ASH) |
129 void ExtensionDialog::InitWindowFullscreen() { | 131 void ExtensionDialog::InitWindowFullscreen() { |
130 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); | 132 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (content::Details<extensions::ExtensionHost>(host()) != details) | 281 if (content::Details<extensions::ExtensionHost>(host()) != details) |
280 return; | 282 return; |
281 if (observer_) | 283 if (observer_) |
282 observer_->ExtensionTerminated(this); | 284 observer_->ExtensionTerminated(this); |
283 break; | 285 break; |
284 default: | 286 default: |
285 NOTREACHED() << L"Received unexpected notification"; | 287 NOTREACHED() << L"Received unexpected notification"; |
286 break; | 288 break; |
287 } | 289 } |
288 } | 290 } |
OLD | NEW |