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

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

Issue 5968009: Change extension unload notification to indicate updates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "app/keyboard_codes.h" 9 #include "app/keyboard_codes.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 NotificationService::current()->Notify( 258 NotificationService::current()->Notify(
259 NotificationType::EXTENSION_PROCESS_CREATED, 259 NotificationType::EXTENSION_PROCESS_CREATED,
260 Source<Profile>(profile_), 260 Source<Profile>(profile_),
261 Details<ExtensionHost>(this)); 261 Details<ExtensionHost>(this));
262 break; 262 break;
263 case NotificationType::EXTENSION_UNLOADED: 263 case NotificationType::EXTENSION_UNLOADED:
264 // The extension object will be deleted after this notification has been 264 // The extension object will be deleted after this notification has been
265 // sent. NULL it out so that dirty pointer issues don't arise in cases 265 // sent. NULL it out so that dirty pointer issues don't arise in cases
266 // when multiple ExtensionHost objects pointing to the same Extension are 266 // when multiple ExtensionHost objects pointing to the same Extension are
267 // present. 267 // present.
268 if (extension_ == Details<const Extension>(details).ptr()) 268 if (extension_ == Details<UnloadedExtensionInfo>(details)->extension)
269 extension_ = NULL; 269 extension_ = NULL;
270 break; 270 break;
271 default: 271 default:
272 NOTREACHED() << "Unexpected notification sent."; 272 NOTREACHED() << "Unexpected notification sent.";
273 break; 273 break;
274 } 274 }
275 } 275 }
276 276
277 void ExtensionHost::UpdatePreferredSize(const gfx::Size& new_size) { 277 void ExtensionHost::UpdatePreferredSize(const gfx::Size& new_size) {
278 if (view_.get()) 278 if (view_.get())
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 // Extensions hosted in ExternalTabContainer objects may not have 794 // Extensions hosted in ExternalTabContainer objects may not have
795 // an associated browser. 795 // an associated browser.
796 Browser* browser = GetBrowser(); 796 Browser* browser = GetBrowser();
797 if (browser) 797 if (browser)
798 window_id = ExtensionTabUtil::GetWindowId(browser); 798 window_id = ExtensionTabUtil::GetWindowId(browser);
799 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { 799 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) {
800 NOTREACHED(); 800 NOTREACHED();
801 } 801 }
802 return window_id; 802 return window_id;
803 } 803 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698