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

Unified Diff: chrome/test/automation/extension_proxy.cc

Issue 10115018: Convert the infobars interactive_ui_test to a browser_test. Remove the ExtensionProxy class which… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « chrome/test/automation/extension_proxy.h ('k') | chrome/test/automation/extension_proxy_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/extension_proxy.cc
===================================================================
--- chrome/test/automation/extension_proxy.cc (revision 132618)
+++ chrome/test/automation/extension_proxy.cc (working copy)
@@ -1,113 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "chrome/test/automation/extension_proxy.h"
-
-#include "base/string_number_conversions.h"
-#include "chrome/common/automation_messages.h"
-#include "chrome/test/automation/automation_proxy.h"
-#include "chrome/test/automation/browser_proxy.h"
-
-ExtensionProxy::ExtensionProxy(AutomationMessageSender* sender,
- AutomationHandleTracker* tracker,
- int handle)
- : AutomationResourceProxy(tracker, sender, handle) {
-}
-
-bool ExtensionProxy::Uninstall() {
- if (!is_valid())
- return false;
-
- bool success = false;
- if (!sender_->Send(new AutomationMsg_UninstallExtension(handle_, &success)))
- return false;
- return success;
-}
-
-bool ExtensionProxy::Enable() {
- if (!is_valid())
- return false;
-
- bool success = false;
- if (!sender_->Send(new AutomationMsg_EnableExtension(handle_, &success)))
- return false;
- return success;
-}
-
-bool ExtensionProxy::Disable() {
- if (!is_valid())
- return false;
-
- bool success = false;
- if (!sender_->Send(new AutomationMsg_DisableExtension(handle_, &success)))
- return false;
- return success;
-}
-
-bool ExtensionProxy::ExecuteActionInActiveTabAsync(BrowserProxy* browser) {
- if (!is_valid())
- return false;
-
- bool success = false;
- if (!sender_->Send(new AutomationMsg_ExecuteExtensionActionInActiveTabAsync(
- handle_, browser->handle(), &success)))
- return false;
- return success;
-}
-
-bool ExtensionProxy::MoveBrowserAction(int index) {
- if (!is_valid())
- return false;
- bool success = false;
- if (!sender_->Send(
- new AutomationMsg_MoveExtensionBrowserAction(handle_, index, &success)))
- return false;
- return success;
-}
-
-bool ExtensionProxy::GetId(std::string* id) {
- DCHECK(id);
- return GetProperty(AUTOMATION_MSG_EXTENSION_ID, id);
-}
-
-bool ExtensionProxy::GetName(std::string* name) {
- DCHECK(name);
- return GetProperty(AUTOMATION_MSG_EXTENSION_NAME, name);
-}
-
-bool ExtensionProxy::GetVersion(std::string* version) {
- DCHECK(version);
- return GetProperty(AUTOMATION_MSG_EXTENSION_VERSION, version);
-}
-
-bool ExtensionProxy::GetBrowserActionIndex(int* index) {
- DCHECK(index);
- std::string index_string;
- if (!GetProperty(AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX,
- &index_string))
- return false;
- // Do not modify |index| until we are sure we can get the value, just to be
- // nice to the caller.
- int converted_index;
- if (!base::StringToInt(index_string, &converted_index)) {
- LOG(ERROR) << "Received index string could not be converted to int: "
- << index_string;
- return false;
- }
- *index = converted_index;
- return true;
-}
-
-bool ExtensionProxy::GetProperty(AutomationMsg_ExtensionProperty type,
- std::string* value) {
- DCHECK(value);
- if (!is_valid())
- return false;
-
- bool success = false;
- if (!sender_->Send(new AutomationMsg_GetExtensionProperty(handle_, type,
- &success, value)))
- return false;
- return success;
-}
« no previous file with comments | « chrome/test/automation/extension_proxy.h ('k') | chrome/test/automation/extension_proxy_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698