Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1456)

Side by Side Diff: chrome/browser/extensions/extension_view_host.cc

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698