diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-22 01:08:16 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-22 01:08:16 +0000 |
commit | 102946ac7121f077854161d0bf0c3019f8c39bd6 (patch) | |
tree | 82217ecb50974d2e4ee15a338e203921e987b8d6 | |
parent | 059ca085ce52beb7c186332700959553dade21b2 (diff) | |
download | chromium_src-102946ac7121f077854161d0bf0c3019f8c39bd6.zip chromium_src-102946ac7121f077854161d0bf0c3019f8c39bd6.tar.gz chromium_src-102946ac7121f077854161d0bf0c3019f8c39bd6.tar.bz2 |
Change the code based on Raf's feedback.
BUG=None
TEST=Unit tests
Review URL: http://codereview.chromium.org/2074022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47980 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 047f9aa..ea83b08 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -282,12 +282,13 @@ bool GetAllWindowsFunction::RunImpl() { bool CreateWindowFunction::RunImpl() { GURL url; + DictionaryValue* args = NULL; - // Look for optional url. - if (HasOptionalArgument(0)) { - DictionaryValue* args; + if (HasOptionalArgument(0)) EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); + // Look for optional url. + if (args) { std::string url_string; if (args->HasKey(keys::kUrlKey)) { EXTENSION_FUNCTION_VALIDATE(args->GetString(keys::kUrlKey, @@ -317,10 +318,7 @@ bool CreateWindowFunction::RunImpl() { Profile* window_profile = profile(); Browser::Type window_type = Browser::TYPE_NORMAL; - if (!args_->empty()) { - DictionaryValue* args; - EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); - + if (args) { // Any part of the bounds can optionally be set by the caller. int bounds_val; if (args->HasKey(keys::kLeftKey)) { |