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

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

Issue 964193002: Cleanup/ Remove deprecated extension notification from ExtensionHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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') | extensions/browser/extension_host.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 void ExtensionViewHost::OnDidStopLoading() { 101 void ExtensionViewHost::OnDidStopLoading() {
102 DCHECK(did_stop_loading()); 102 DCHECK(did_stop_loading());
103 view_->DidStopLoading(); 103 view_->DidStopLoading();
104 } 104 }
105 105
106 void ExtensionViewHost::LoadInitialURL() { 106 void ExtensionViewHost::LoadInitialURL() {
107 if (!ExtensionSystem::Get(browser_context())-> 107 if (!ExtensionSystem::Get(browser_context())->
108 runtime_data()->IsBackgroundPageReady(extension())) { 108 runtime_data()->IsBackgroundPageReady(extension())) {
109 // Make sure the background page loads before any others. 109 // Make sure the background page loads before any others.
110 registrar()->Add(this, 110 registrar_.Add(this,
111 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, 111 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
112 content::Source<Extension>(extension())); 112 content::Source<Extension>(extension()));
113 return; 113 return;
114 } 114 }
115 115
116 // Popups may spawn modal dialogs, which need positioning information. 116 // Popups may spawn modal dialogs, which need positioning information.
117 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) { 117 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) {
118 WebContentsModalDialogManager::CreateForWebContents(host_contents()); 118 WebContentsModalDialogManager::CreateForWebContents(host_contents());
119 WebContentsModalDialogManager::FromWebContents( 119 WebContentsModalDialogManager::FromWebContents(
120 host_contents())->SetDelegate(this); 120 host_contents())->SetDelegate(this);
121 if (!popup_manager_.get()) 121 if (!popup_manager_.get())
122 popup_manager_.reset(new web_modal::PopupManager(this)); 122 popup_manager_.reset(new web_modal::PopupManager(this));
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 if (associated_web_contents_) 289 if (associated_web_contents_)
290 return associated_web_contents_; 290 return associated_web_contents_;
291 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP) 291 if (extension_host_type() == VIEW_TYPE_EXTENSION_POPUP)
292 return host_contents(); 292 return host_contents();
293 return NULL; 293 return NULL;
294 } 294 }
295 295
296 void ExtensionViewHost::Observe(int type, 296 void ExtensionViewHost::Observe(int type,
297 const content::NotificationSource& source, 297 const content::NotificationSource& source,
298 const content::NotificationDetails& details) { 298 const content::NotificationDetails& details) {
299 if (type == extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY) { 299 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY);
300 DCHECK(ExtensionSystem::Get(browser_context())-> 300 DCHECK(ExtensionSystem::Get(browser_context())
301 runtime_data()->IsBackgroundPageReady(extension())); 301 ->runtime_data()
302 LoadInitialURL(); 302 ->IsBackgroundPageReady(extension()));
303 return; 303 LoadInitialURL();
304 }
305 ExtensionHost::Observe(type, source, details);
306 } 304 }
307 305
308 } // namespace extensions 306 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view_host.h ('k') | extensions/browser/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698