summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:05:34 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:05:34 +0000
commitf7838702ca4c4c33cf25329d61e533b8153da9a8 (patch)
tree8bbca25600629df82f49b55b86e78c09ba90fbc5 /chrome
parent3c4a1ff0b302b1b564a46abe3294c7cf4d5fdfc1 (diff)
downloadchromium_src-f7838702ca4c4c33cf25329d61e533b8153da9a8.zip
chromium_src-f7838702ca4c4c33cf25329d61e533b8153da9a8.tar.gz
chromium_src-f7838702ca4c4c33cf25329d61e533b8153da9a8.tar.bz2
Move constants related to chrome.tabs.executeScript() from the .cc file to
the .h file with all the other chrome.tabs.* constants. BUG=none TEST=none Review URL: http://codereview.chromium.org/545119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/execute_code_in_tab_function.cc20
-rw-r--r--chrome/browser/extensions/extension_tabs_module_constants.cc3
-rw-r--r--chrome/browser/extensions/extension_tabs_module_constants.h3
3 files changed, 14 insertions, 12 deletions
diff --git a/chrome/browser/extensions/execute_code_in_tab_function.cc b/chrome/browser/extensions/execute_code_in_tab_function.cc
index 3d15458..56f3353 100644
--- a/chrome/browser/extensions/execute_code_in_tab_function.cc
+++ b/chrome/browser/extensions/execute_code_in_tab_function.cc
@@ -16,10 +16,6 @@
namespace keys = extension_tabs_module_constants;
-const wchar_t* kCodeKey = L"code";
-const wchar_t* kFileKey = L"file";
-const wchar_t* kAllFramesKey = L"allFrames";
-
bool ExecuteCodeInTabFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(args_->IsType(Value::TYPE_LIST));
const ListValue* args = args_as_list();
@@ -31,8 +27,8 @@ bool ExecuteCodeInTabFunction::RunImpl() {
error_ = keys::kNoCodeOrFileToExecuteError;
return false;
} else {
- bool has_code = script_info->HasKey(kCodeKey);
- bool has_file = script_info->HasKey(kFileKey);
+ bool has_code = script_info->HasKey(keys::kCodeKey);
+ bool has_file = script_info->HasKey(keys::kFileKey);
if (has_code && has_file) {
error_ = keys::kMoreThanOneValuesError;
return false;
@@ -87,14 +83,14 @@ bool ExecuteCodeInTabFunction::RunImpl() {
return false;
}
- if (script_info->HasKey(kAllFramesKey)) {
- if (!script_info->GetBoolean(kAllFramesKey, &all_frames_))
+ if (script_info->HasKey(keys::kAllFramesKey)) {
+ if (!script_info->GetBoolean(keys::kAllFramesKey, &all_frames_))
return false;
}
std::string code_string;
- if (script_info->HasKey(kCodeKey)) {
- if (!script_info->GetString(kCodeKey, &code_string))
+ if (script_info->HasKey(keys::kCodeKey)) {
+ if (!script_info->GetString(keys::kCodeKey, &code_string))
return false;
}
@@ -104,8 +100,8 @@ bool ExecuteCodeInTabFunction::RunImpl() {
}
std::string relative_path;
- if (script_info->HasKey(kFileKey)) {
- if (!script_info->GetString(kFileKey, &relative_path))
+ if (script_info->HasKey(keys::kFileKey)) {
+ if (!script_info->GetString(keys::kFileKey, &relative_path))
return false;
resource_ = GetExtension()->GetResource(relative_path);
}
diff --git a/chrome/browser/extensions/extension_tabs_module_constants.cc b/chrome/browser/extensions/extension_tabs_module_constants.cc
index 0d21460..8e62d68 100644
--- a/chrome/browser/extensions/extension_tabs_module_constants.cc
+++ b/chrome/browser/extensions/extension_tabs_module_constants.cc
@@ -6,7 +6,10 @@
namespace extension_tabs_module_constants {
+const wchar_t kAllFramesKey[] = L"allFrames";
+const wchar_t kCodeKey[] = L"code";
const wchar_t kFavIconUrlKey[] = L"favIconUrl";
+const wchar_t kFileKey[] = L"file";
const wchar_t kFocusedKey[] = L"focused";
const wchar_t kFromIndexKey[] = L"fromIndex";
const wchar_t kHeightKey[] = L"height";
diff --git a/chrome/browser/extensions/extension_tabs_module_constants.h b/chrome/browser/extensions/extension_tabs_module_constants.h
index a8bf1ac..3cd8f76 100644
--- a/chrome/browser/extensions/extension_tabs_module_constants.h
+++ b/chrome/browser/extensions/extension_tabs_module_constants.h
@@ -10,7 +10,10 @@
namespace extension_tabs_module_constants {
// Keys used in serializing tab data & events.
+extern const wchar_t kAllFramesKey[];
+extern const wchar_t kCodeKey[];
extern const wchar_t kFavIconUrlKey[];
+extern const wchar_t kFileKey[];
extern const wchar_t kFocusedKey[];
extern const wchar_t kFromIndexKey[];
extern const wchar_t kHeightKey[];