summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorshuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 08:57:39 +0000
committershuchen@chromium.org <shuchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-18 08:57:39 +0000
commitab7ca97b1b8ffd0b9d9cb7b569fedc9ab7201bfb (patch)
tree1ccf03400d3f8e107d668b6b3c4edf3fbd4a33b9 /chrome/common
parent5f2f5a5458bcaa44acbcb5a2b1ecfba6dce10324 (diff)
downloadchromium_src-ab7ca97b1b8ffd0b9d9cb7b569fedc9ab7201bfb.zip
chromium_src-ab7ca97b1b8ffd0b9d9cb7b569fedc9ab7201bfb.tar.gz
chromium_src-ab7ca97b1b8ffd0b9d9cb7b569fedc9ab7201bfb.tar.bz2
[IME] Supports options page for each IME instead of single options page for each IME extension.
BUG=334527 TEST=Verified on sandbox. Review URL: https://codereview.chromium.org/136693012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/api/input_ime/input_components_handler.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.cc b/chrome/common/extensions/api/input_ime/input_components_handler.cc
index 67a1c95..2fe6bf0 100644
--- a/chrome/common/extensions/api/input_ime/input_components_handler.cc
+++ b/chrome/common/extensions/api/input_ime/input_components_handler.cc
@@ -64,6 +64,7 @@ bool InputComponentsHandler::Parse(Extension* extension,
std::set<std::string> layouts;
std::string shortcut_keycode_str;
GURL input_view_url;
+ GURL options_page_url;
bool shortcut_alt = false;
bool shortcut_ctrl = false;
bool shortcut_shift = false;
@@ -194,6 +195,22 @@ bool InputComponentsHandler::Parse(Extension* extension,
}
}
+ // Get input_components[i].options_page_url.
+ // Note: 'options_page' is optional in manifest.
+ std::string options_page_str;
+ if (module_value->GetString(keys::kImeOptionsPage, &options_page_str)) {
+ options_page_url = extension->GetResourceURL(options_page_str);
+ if (!options_page_url.is_valid()) {
+ *error = ErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidOptionsPage,
+ base::IntToString(i));
+ return false;
+ }
+ } else {
+ // Fall back to extension's options page for backward compatibility.
+ options_page_url = extensions::ManifestURL::GetOptionsPage(extension);
+ }
+
info->input_components.push_back(InputComponentInfo());
info->input_components.back().name = name_str;
info->input_components.back().type = type;
@@ -206,8 +223,7 @@ bool InputComponentsHandler::Parse(Extension* extension,
info->input_components.back().shortcut_alt = shortcut_alt;
info->input_components.back().shortcut_ctrl = shortcut_ctrl;
info->input_components.back().shortcut_shift = shortcut_shift;
- info->input_components.back().options_page_url =
- extensions::ManifestURL::GetOptionsPage(extension);
+ info->input_components.back().options_page_url = options_page_url;
info->input_components.back().input_view_url = input_view_url;
}
extension->SetManifestData(keys::kInputComponents, info.release());