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

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

Issue 586933002: Re-Revert "[WebModals] New API for browser-scoped popup management." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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
« no previous file with comments | « chrome/browser/extensions/extension_view_host.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extension_view.h" 9 #include "chrome/browser/extensions/extension_view.h"
10 #include "chrome/browser/extensions/window_controller.h" 10 #include "chrome/browser/extensions/window_controller.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, 120 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
121 content::Source<Extension>(extension())); 121 content::Source<Extension>(extension()));
122 return; 122 return;
123 } 123 }
124 124
125 // Popups may spawn modal dialogs, which need positioning information. 125 // Popups may spawn modal dialogs, which need positioning information.
126 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) { 126 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) {
127 WebContentsModalDialogManager::CreateForWebContents(host_contents()); 127 WebContentsModalDialogManager::CreateForWebContents(host_contents());
128 WebContentsModalDialogManager::FromWebContents( 128 WebContentsModalDialogManager::FromWebContents(
129 host_contents())->SetDelegate(this); 129 host_contents())->SetDelegate(this);
130 if (!popup_manager_.get())
131 popup_manager_.reset(new web_modal::PopupManager(this));
132 popup_manager_->RegisterWith(host_contents());
133 } 130 }
134 131
135 ExtensionHost::LoadInitialURL(); 132 ExtensionHost::LoadInitialURL();
136 } 133 }
137 134
138 bool ExtensionViewHost::IsBackgroundPage() const { 135 bool ExtensionViewHost::IsBackgroundPage() const {
139 DCHECK(view_); 136 DCHECK(view_);
140 return false; 137 return false;
141 } 138 }
142 139
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 313
317 void ExtensionViewHost::InsertInfobarCSS() { 314 void ExtensionViewHost::InsertInfobarCSS() {
318 static const base::StringPiece css( 315 static const base::StringPiece css(
319 ResourceBundle::GetSharedInstance().GetRawDataResource( 316 ResourceBundle::GetSharedInstance().GetRawDataResource(
320 IDR_EXTENSIONS_INFOBAR_CSS)); 317 IDR_EXTENSIONS_INFOBAR_CSS));
321 318
322 host_contents()->InsertCSS(css.as_string()); 319 host_contents()->InsertCSS(css.as_string());
323 } 320 }
324 321
325 } // namespace extensions 322 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view_host.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698