| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/extension_view_host.h" | 5 #include "chrome/browser/extensions/extension_view_host.h" |
| 6 | 6 |
| 7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/window_controller.h" | 9 #include "chrome/browser/extensions/window_controller.h" |
| 10 #include "chrome/browser/file_select_helper.h" | 10 #include "chrome/browser/file_select_helper.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 143 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 144 content::Source<Extension>(extension())); | 144 content::Source<Extension>(extension())); |
| 145 return; | 145 return; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Popups may spawn modal dialogs, which need positioning information. | 148 // Popups may spawn modal dialogs, which need positioning information. |
| 149 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) { | 149 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) { |
| 150 WebContentsModalDialogManager::CreateForWebContents(host_contents()); | 150 WebContentsModalDialogManager::CreateForWebContents(host_contents()); |
| 151 WebContentsModalDialogManager::FromWebContents( | 151 WebContentsModalDialogManager::FromWebContents( |
| 152 host_contents())->SetDelegate(this); | 152 host_contents())->SetDelegate(this); |
| 153 if (!popup_manager_.get()) |
| 154 popup_manager_.reset(new web_modal::PopupManager(this)); |
| 155 popup_manager_->RegisterWith(host_contents()); |
| 153 } | 156 } |
| 154 | 157 |
| 155 ExtensionHost::LoadInitialURL(); | 158 ExtensionHost::LoadInitialURL(); |
| 156 } | 159 } |
| 157 | 160 |
| 158 bool ExtensionViewHost::IsBackgroundPage() const { | 161 bool ExtensionViewHost::IsBackgroundPage() const { |
| 159 DCHECK(view_); | 162 DCHECK(view_); |
| 160 return false; | 163 return false; |
| 161 } | 164 } |
| 162 | 165 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 339 |
| 337 void ExtensionViewHost::InsertInfobarCSS() { | 340 void ExtensionViewHost::InsertInfobarCSS() { |
| 338 static const base::StringPiece css( | 341 static const base::StringPiece css( |
| 339 ResourceBundle::GetSharedInstance().GetRawDataResource( | 342 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 340 IDR_EXTENSIONS_INFOBAR_CSS)); | 343 IDR_EXTENSIONS_INFOBAR_CSS)); |
| 341 | 344 |
| 342 host_contents()->InsertCSS(css.as_string()); | 345 host_contents()->InsertCSS(css.as_string()); |
| 343 } | 346 } |
| 344 | 347 |
| 345 } // namespace extensions | 348 } // namespace extensions |
| OLD | NEW |