Skip to content

Commit

Permalink
Fix enable state of Pepper Flash.
Browse files Browse the repository at this point in the history
Component-updated and bundled Pepper Flash share the same enable state. When
reading from the Preferences file, the previous code ignored the enable state
if it was associated with the component-updated path. That was wrong because if
the component-updated Flash was newer, the enable state would be recorded with
that path. The outcome was that everytime users restarted the browser, Pepper
Flash was enabled, even if they disabled it before.

TBR=bauerb@chromium.org
BUG=150596
TEST=None

Review URL: https://codereview.chromium.org/12079044

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180288 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
yzshen@chromium.org committed Feb 3, 2013
1 parent bcb6ee2 commit 3d77b5b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
9 changes: 1 addition & 8 deletions chrome/browser/plugins/plugin_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ void PluginPrefs::PluginState::Set(const FilePath& plugin, bool enabled) {
state_[ConvertMapKey(plugin)] = enabled;
}

void PluginPrefs::PluginState::SetIgnorePseudoKey(const FilePath& plugin,
bool enabled) {
FilePath key = ConvertMapKey(plugin);
if (key == plugin)
state_[key] = enabled;
}

FilePath PluginPrefs::PluginState::ConvertMapKey(const FilePath& plugin) const {
// Keep the state of component-updated and bundled Pepper Flash in sync.
if (plugin.BaseName().value() == chrome::kPepperFlashPluginFilename) {
Expand Down Expand Up @@ -466,7 +459,7 @@ void PluginPrefs::SetPrefs(PrefService* prefs) {
pepper_flash_node = plugin;
}

plugin_state_.SetIgnorePseudoKey(plugin_path, enabled);
plugin_state_.Set(plugin_path, enabled);
} else if (!enabled && plugin->GetString("name", &group_name)) {
// Don't disable this group if it's for the pdf or nacl plugins and
// we just forced it on.
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/plugins/plugin_prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ class PluginPrefs : public RefcountedProfileKeyedService {
// |*enabled| won't be touched.
bool Get(const FilePath& plugin, bool* enabled) const;
void Set(const FilePath& plugin, bool enabled);
// It is similar to Set(), except that it does nothing if |plugin| needs to
// be converted to a different key.
void SetIgnorePseudoKey(const FilePath& plugin, bool enabled);

private:
FilePath ConvertMapKey(const FilePath& plugin) const;
Expand Down

0 comments on commit 3d77b5b

Please sign in to comment.