Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5485)

Unified Diff: chrome/browser/extensions/api/execute_code_function.h

Issue 538063003: Move execute_code_function to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn build Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/execute_code_function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/execute_code_function.h
diff --git a/chrome/browser/extensions/api/execute_code_function.h b/chrome/browser/extensions/api/execute_code_function.h
deleted file mode 100644
index f5227f52c4fa9ff58deb03fa055a44f65f41d8a7..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/api/execute_code_function.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_EXTENSIONS_API_EXECUTE_CODE_FUNCTION_H_
-#define CHROME_BROWSER_EXTENSIONS_API_EXECUTE_CODE_FUNCTION_H_
-
-#include "chrome/common/extensions/api/tabs.h"
-#include "extensions/browser/extension_function.h"
-#include "extensions/browser/script_executor.h"
-
-namespace extensions {
-
-// Base class for javascript code injection.
-// This is used by both chrome.webview.executeScript and
-// chrome.tabs.executeScript.
-class ExecuteCodeFunction : public AsyncExtensionFunction {
- public:
- ExecuteCodeFunction();
-
- protected:
- virtual ~ExecuteCodeFunction();
-
- // ExtensionFunction implementation.
- virtual bool HasPermission() OVERRIDE;
- virtual bool RunAsync() OVERRIDE;
-
- // Initialize |details_| if it hasn't already been.
- virtual bool Init() = 0;
- virtual bool ShouldInsertCSS() const = 0;
- virtual bool CanExecuteScriptOnPage() = 0;
- virtual ScriptExecutor* GetScriptExecutor() = 0;
- virtual bool IsWebView() const = 0;
- virtual const GURL& GetWebViewSrc() const = 0;
- virtual void OnExecuteCodeFinished(const std::string& error,
- const GURL& on_url,
- const base::ListValue& result);
-
- // The injection details.
- scoped_ptr<api::tabs::InjectDetails> details_;
-
- private:
- // Called when contents from the file whose path is specified in JSON
- // arguments has been loaded.
- void DidLoadFile(bool success, const std::string& data);
-
- // Runs on FILE thread. Loads message bundles for the extension and
- // localizes the CSS data. Calls back DidLoadAndLocalizeFile on the UI thread.
- void GetFileURLAndLocalizeCSS(
- ScriptExecutor::ScriptType script_type,
- const std::string& data,
- const std::string& extension_id,
- const base::FilePath& extension_path,
- const std::string& extension_default_locale);
-
- // Called when contents from the loaded file have been localized.
- void DidLoadAndLocalizeFile(bool success, const std::string& data);
-
- // Run in UI thread. Code string contains the code to be executed. Returns
- // true on success. If true is returned, this does an AddRef.
- bool Execute(const std::string& code_string);
-
- // Contains extension resource built from path of file which is
- // specified in JSON arguments.
- ExtensionResource resource_;
-
- // The URL of the file being injected into the page.
- GURL file_url_;
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_EXECUTE_CODE_FUNCTION_H_
-
« no previous file with comments | « no previous file | chrome/browser/extensions/api/execute_code_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698