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

Side by Side Diff: chrome/test/automation/tab_proxy.cc

Issue 366025: Modifying extension automation so that it is done through a particular... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/automation/tab_proxy.h" 5 #include "chrome/test/automation/tab_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/common/json_value_serializer.h" 10 #include "chrome/common/json_value_serializer.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 // Wrap |json| in an array before deserializing because valid JSON has an 349 // Wrap |json| in an array before deserializing because valid JSON has an
350 // array or an object as the root. 350 // array or an object as the root.
351 json.insert(0, "["); 351 json.insert(0, "[");
352 json.append("]"); 352 json.append("]");
353 353
354 JSONStringValueSerializer deserializer(json); 354 JSONStringValueSerializer deserializer(json);
355 *value = deserializer.Deserialize(NULL); 355 *value = deserializer.Deserialize(NULL);
356 return *value != NULL; 356 return *value != NULL;
357 } 357 }
358 358
359 bool TabProxy::SetEnableExtensionAutomation(
360 const std::vector<std::string>& functions_enabled) {
361 if (!is_valid())
362 return false;
363
364 return sender_->Send(new AutomationMsg_SetEnableExtensionAutomation(
365 0, handle_, functions_enabled));
366 }
367
359 bool TabProxy::GetConstrainedWindowCount(int* count) const { 368 bool TabProxy::GetConstrainedWindowCount(int* count) const {
360 if (!is_valid()) 369 if (!is_valid())
361 return false; 370 return false;
362 371
363 if (!count) { 372 if (!count) {
364 NOTREACHED(); 373 NOTREACHED();
365 return false; 374 return false;
366 } 375 }
367 376
368 return sender_->Send(new AutomationMsg_ConstrainedWindowCount( 377 return sender_->Send(new AutomationMsg_ConstrainedWindowCount(
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 AutoLock lock(list_lock_); 731 AutoLock lock(list_lock_);
723 observers_list_.RemoveObserver(observer); 732 observers_list_.RemoveObserver(observer);
724 } 733 }
725 734
726 // Called on Channel background thread, if TabMessages filter is installed. 735 // Called on Channel background thread, if TabMessages filter is installed.
727 void TabProxy::OnMessageReceived(const IPC::Message& message) { 736 void TabProxy::OnMessageReceived(const IPC::Message& message) {
728 AutoLock lock(list_lock_); 737 AutoLock lock(list_lock_);
729 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_, 738 FOR_EACH_OBSERVER(TabProxyDelegate, observers_list_,
730 OnMessageReceived(this, message)); 739 OnMessageReceived(this, message));
731 } 740 }
OLDNEW
« no previous file with comments | « chrome/test/automation/tab_proxy.h ('k') | chrome/test/data/extensions/uitest/roundtrip_api_call/background.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698