summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos
diff options
context:
space:
mode:
authorers@chromium.org <ers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 03:43:09 +0000
committerers@chromium.org <ers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-19 03:43:09 +0000
commit0c2322f43b1d12ef29479cc783400937558fd067 (patch)
treebc49f374d2e819888e8550a69173f3cb2ee4940e /chrome/browser/chromeos
parentc615d1c3847902b3e792b85f97c5f1f0231aeee9 (diff)
downloadchromium_src-0c2322f43b1d12ef29479cc783400937558fd067.zip
chromium_src-0c2322f43b1d12ef29479cc783400937558fd067.tar.gz
chromium_src-0c2322f43b1d12ef29479cc783400937558fd067.tar.bz2
Chrome OS: Invoke the correct virtual ParseValue method when creating networks.
With the recent refactoring of the network property parsing code, there is now a hierarchy of parsers, with a virtual ParseValue method that's overridden by each subclass. In the code that creates a new network from a dictionary of properties (in NetworkLibraryImplCros::ParseNetwork), a local NativeNetworkParser object is defined, and its CreateNetworkFromInfo() method is called. The call chain was then NetworkParser::CreateNetworkFromInfo -> NetworkParser::UpdateNetworkFromInfo -> NetworkParser::UpdateStatus -> NativeNetworkParser::ParseValue In other words, the ParseValue method of the base NativeNetworkParser was being invoked for all properties. As a result, none of the wireless-specific or cellular-specific properties were recognized. The fix is to replace the call to NetworkParser::UpdateStatus with a call to Network::UpdateStatus. That way, when the latter method invokes UpdateStatus on the parser, it is using the network-type-specific parser that was created when the network was created, and the correct ParseValue method ends up being used. BUG=none TEST=The problem exhibited itself when there was a registered cellular network. If the user disabled mobile data, and then re-enabled it, the cellular network would reappear, but none of the cellular-specific properties were defined (so, e.g., there was no network technology badge, the activation status was unknown, etc.). R=gspencer@chromium.org Review URL: http://codereview.chromium.org/7655053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97418 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r--chrome/browser/chromeos/cros/network_parser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/cros/network_parser.cc b/chrome/browser/chromeos/cros/network_parser.cc
index 7657655..5d3dfd4 100644
--- a/chrome/browser/chromeos/cros/network_parser.cc
+++ b/chrome/browser/chromeos/cros/network_parser.cc
@@ -134,7 +134,7 @@ bool NetworkParser::UpdateNetworkFromInfo(const DictionaryValue& info,
bool res = info.GetWithoutPathExpansion(key, &value);
DCHECK(res);
if (res)
- UpdateStatus(key, *value, network, NULL);
+ network->UpdateStatus(key, *value, NULL);
}
if (network->unique_id().empty())
network->CalculateUniqueId();