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

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: . 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
« 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 chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, 120 chrome::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());
130 } 133 }
131 134
132 ExtensionHost::LoadInitialURL(); 135 ExtensionHost::LoadInitialURL();
133 } 136 }
134 137
135 bool ExtensionViewHost::IsBackgroundPage() const { 138 bool ExtensionViewHost::IsBackgroundPage() const {
136 DCHECK(view_); 139 DCHECK(view_);
137 return false; 140 return false;
138 } 141 }
139 142
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 316
314 void ExtensionViewHost::InsertInfobarCSS() { 317 void ExtensionViewHost::InsertInfobarCSS() {
315 static const base::StringPiece css( 318 static const base::StringPiece css(
316 ResourceBundle::GetSharedInstance().GetRawDataResource( 319 ResourceBundle::GetSharedInstance().GetRawDataResource(
317 IDR_EXTENSIONS_INFOBAR_CSS)); 320 IDR_EXTENSIONS_INFOBAR_CSS));
318 321
319 host_contents()->InsertCSS(css.as_string()); 322 host_contents()->InsertCSS(css.as_string());
320 } 323 }
321 324
322 } // namespace extensions 325 } // 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