OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 6 #define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" // NOLINT | 9 #include "build/build_config.h" // NOLINT |
10 | 10 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 // These handlers issue asynchronous Reload, Stop and SaveAs notifications to | 399 // These handlers issue asynchronous Reload, Stop and SaveAs notifications to |
400 // the chrome instance. | 400 // the chrome instance. |
401 void ReloadAsync(); | 401 void ReloadAsync(); |
402 void StopAsync(); | 402 void StopAsync(); |
403 void SaveAsAsync(); | 403 void SaveAsAsync(); |
404 | 404 |
405 // Calls delegates | 405 // Calls delegates |
406 void AddObserver(TabProxyDelegate* observer); | 406 void AddObserver(TabProxyDelegate* observer); |
407 void RemoveObserver(TabProxyDelegate* observer); | 407 void RemoveObserver(TabProxyDelegate* observer); |
408 void OnMessageReceived(const IPC::Message& message); | 408 bool OnMessageReceived(const IPC::Message& message); |
409 void OnChannelError(); | 409 void OnChannelError(); |
410 protected: | 410 protected: |
411 virtual ~TabProxy(); | 411 virtual ~TabProxy(); |
412 | 412 |
413 // Override JavaScriptExecutionController methods. | 413 // Override JavaScriptExecutionController methods. |
414 // Executes |script| and gets the response JSON. Returns true on success. | 414 // Executes |script| and gets the response JSON. Returns true on success. |
415 bool ExecuteJavaScriptAndGetJSON(const std::string& script, | 415 bool ExecuteJavaScriptAndGetJSON(const std::string& script, |
416 std::string* json) WARN_UNUSED_RESULT; | 416 std::string* json) WARN_UNUSED_RESULT; |
417 | 417 |
418 // Called when tracking the first object. Used for reference counting | 418 // Called when tracking the first object. Used for reference counting |
419 // purposes. | 419 // purposes. |
420 void FirstObjectAdded(); | 420 void FirstObjectAdded(); |
421 | 421 |
422 // Called when no longer tracking any objects. Used for reference counting | 422 // Called when no longer tracking any objects. Used for reference counting |
423 // purposes. | 423 // purposes. |
424 void LastObjectRemoved(); | 424 void LastObjectRemoved(); |
425 | 425 |
426 private: | 426 private: |
427 Lock list_lock_; // Protects the observers_list_. | 427 Lock list_lock_; // Protects the observers_list_. |
428 ObserverList<TabProxyDelegate> observers_list_; | 428 ObserverList<TabProxyDelegate> observers_list_; |
429 DISALLOW_COPY_AND_ASSIGN(TabProxy); | 429 DISALLOW_COPY_AND_ASSIGN(TabProxy); |
430 }; | 430 }; |
431 | 431 |
432 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ | 432 #endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ |
OLD | NEW |