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

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

Issue 653843002: Mac: Attach Extension NSViews to the view hierarchy before creating renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DCHECK Created 5 years, 10 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
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // The hosting WebContents will be deleted in the base class, so unregister 70 // The hosting WebContents will be deleted in the base class, so unregister
71 // this object before it deletes the attached WebContentsModalDialogManager. 71 // this object before it deletes the attached WebContentsModalDialogManager.
72 WebContentsModalDialogManager* manager = 72 WebContentsModalDialogManager* manager =
73 WebContentsModalDialogManager::FromWebContents(host_contents()); 73 WebContentsModalDialogManager::FromWebContents(host_contents());
74 if (manager) 74 if (manager)
75 manager->SetDelegate(NULL); 75 manager->SetDelegate(NULL);
76 } 76 }
77 77
78 void ExtensionViewHost::CreateView(Browser* browser) { 78 void ExtensionViewHost::CreateView(Browser* browser) {
79 view_ = CreateExtensionView(this, browser); 79 view_ = CreateExtensionView(this, browser);
80 view_->Init();
81 } 80 }
82 81
83 void ExtensionViewHost::SetAssociatedWebContents(WebContents* web_contents) { 82 void ExtensionViewHost::SetAssociatedWebContents(WebContents* web_contents) {
84 associated_web_contents_ = web_contents; 83 associated_web_contents_ = web_contents;
85 if (associated_web_contents_) { 84 if (associated_web_contents_) {
86 // Observe the new WebContents for deletion. 85 // Observe the new WebContents for deletion.
87 associated_web_contents_observer_.reset( 86 associated_web_contents_observer_.reset(
88 new AssociatedWebContentsObserver(this, associated_web_contents_)); 87 new AssociatedWebContentsObserver(this, associated_web_contents_));
89 } else { 88 } else {
90 associated_web_contents_observer_.reset(); 89 associated_web_contents_observer_.reset();
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (type == extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY) { 299 if (type == extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY) {
301 DCHECK(ExtensionSystem::Get(browser_context())-> 300 DCHECK(ExtensionSystem::Get(browser_context())->
302 runtime_data()->IsBackgroundPageReady(extension())); 301 runtime_data()->IsBackgroundPageReady(extension()));
303 LoadInitialURL(); 302 LoadInitialURL();
304 return; 303 return;
305 } 304 }
306 ExtensionHost::Observe(type, source, details); 305 ExtensionHost::Observe(type, source, details);
307 } 306 }
308 307
309 } // namespace extensions 308 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view.h ('k') | chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698