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

Side by Side Diff: chrome/browser/extensions/user_script_master.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/user_script_master.h" 5 #include "chrome/browser/extensions/user_script_master.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 lone_scripts_.push_back(*iter); 349 lone_scripts_.push_back(*iter);
350 lone_scripts_.back().set_incognito_enabled(incognito_enabled); 350 lone_scripts_.back().set_incognito_enabled(incognito_enabled);
351 lone_scripts_.back().set_allow_file_access(allow_file_access); 351 lone_scripts_.back().set_allow_file_access(allow_file_access);
352 } 352 }
353 if (extensions_service_ready_) 353 if (extensions_service_ready_)
354 StartScan(); 354 StartScan();
355 break; 355 break;
356 } 356 }
357 case NotificationType::EXTENSION_UNLOADED: { 357 case NotificationType::EXTENSION_UNLOADED: {
358 // Remove any content scripts. 358 // Remove any content scripts.
359 const Extension* extension = Details<const Extension>(details).ptr(); 359 const Extension* extension =
360 Details<UnloadedExtensionInfo>(details)->extension;
360 UserScriptList new_lone_scripts; 361 UserScriptList new_lone_scripts;
361 for (UserScriptList::iterator iter = lone_scripts_.begin(); 362 for (UserScriptList::iterator iter = lone_scripts_.begin();
362 iter != lone_scripts_.end(); ++iter) { 363 iter != lone_scripts_.end(); ++iter) {
363 if (iter->extension_id() != extension->id()) 364 if (iter->extension_id() != extension->id())
364 new_lone_scripts.push_back(*iter); 365 new_lone_scripts.push_back(*iter);
365 } 366 }
366 lone_scripts_ = new_lone_scripts; 367 lone_scripts_ = new_lone_scripts;
367 StartScan(); 368 StartScan();
368 369
369 // TODO(aa): Do we want to do something smarter for the scripts that have 370 // TODO(aa): Do we want to do something smarter for the scripts that have
(...skipping 23 matching lines...) Expand all
393 DCHECK(false); 394 DCHECK(false);
394 } 395 }
395 } 396 }
396 397
397 void UserScriptMaster::StartScan() { 398 void UserScriptMaster::StartScan() {
398 if (!script_reloader_) 399 if (!script_reloader_)
399 script_reloader_ = new ScriptReloader(this); 400 script_reloader_ = new ScriptReloader(this);
400 401
401 script_reloader_->StartScan(user_script_dir_, lone_scripts_); 402 script_reloader_->StartScan(user_script_dir_, lone_scripts_);
402 } 403 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698