Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/renderer/test_runner/MockColorChooser.h" | 5 #include "content/shell/renderer/test_runner/mock_color_chooser.h" |
| 6 | 6 |
| 7 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 7 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 8 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 8 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 9 | 9 |
| 10 using namespace blink; | 10 using namespace blink; |
|
jochen (gone - plz use gerrit)
2014/07/22 07:26:45
don't use namespace blink, but either use the type
Abhishek
2014/07/22 10:49:56
Done.
| |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 class HostMethodTask : public WebMethodTask<MockColorChooser> { | 15 class HostMethodTask : public WebMethodTask<MockColorChooser> { |
| 16 public: | 16 public: |
| 17 typedef void (MockColorChooser::*CallbackMethodType)(); | 17 typedef void (MockColorChooser::*CallbackMethodType)(); |
| 18 HostMethodTask(MockColorChooser* object, CallbackMethodType callback) | 18 HostMethodTask(MockColorChooser* object, CallbackMethodType callback) |
| 19 : WebMethodTask<MockColorChooser>(object) | 19 : WebMethodTask<MockColorChooser>(object) |
| 20 , m_callback(callback) | 20 , callback_(callback) |
|
jochen (gone - plz use gerrit)
2014/07/22 07:26:45
, should go on previous line
Abhishek
2014/07/22 10:49:56
Done.
| |
| 21 { } | 21 { } |
| 22 | 22 |
| 23 virtual void runIfValid() OVERRIDE { (m_object->*m_callback)(); } | 23 virtual void runIfValid() OVERRIDE { (m_object->*callback_)(); } |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 CallbackMethodType m_callback; | 26 CallbackMethodType callback_; |
| 27 }; | 27 }; |
| 28 } | 28 } |
| 29 | 29 |
| 30 MockColorChooser::MockColorChooser(blink::WebColorChooserClient* client, WebTest Delegate* delegate, WebTestProxyBase* proxy) | 30 MockColorChooser::MockColorChooser(blink::WebColorChooserClient* client, |
| 31 : m_client(client) | 31 WebTestDelegate* delegate, |
| 32 , m_delegate(delegate) | 32 WebTestProxyBase* proxy) |
| 33 , m_proxy(proxy) | 33 : client_(client) |
| 34 , delegate_(delegate) | |
|
jochen (gone - plz use gerrit)
2014/07/22 07:26:45
same here
Abhishek
2014/07/22 10:49:56
Done.
| |
| 35 , proxy_(proxy) | |
| 34 { | 36 { |
| 35 m_proxy->DidOpenChooser(); | 37 proxy_->DidOpenChooser(); |
| 36 } | 38 } |
| 37 | 39 |
| 38 MockColorChooser::~MockColorChooser() | 40 MockColorChooser::~MockColorChooser() |
| 39 { | 41 { |
| 40 m_proxy->DidCloseChooser(); | 42 proxy_->DidCloseChooser(); |
| 41 } | 43 } |
| 42 | 44 |
| 43 void MockColorChooser::setSelectedColor(const blink::WebColor) | 45 void MockColorChooser::setSelectedColor(const blink::WebColor) |
|
jochen (gone - plz use gerrit)
2014/07/22 07:26:45
add parameter name also for unused args
Abhishek
2014/07/22 10:49:56
Done.
| |
| 44 { | 46 { |
| 45 } | 47 } |
| 46 | 48 |
| 47 void MockColorChooser::endChooser() | 49 void MockColorChooser::endChooser() |
| 48 { | 50 { |
| 49 m_delegate->postDelayedTask(new HostMethodTask(this, &MockColorChooser::invo keDidEndChooser), 0); | 51 delegate_->postDelayedTask(new HostMethodTask(this, &MockColorChooser::Invok eDidEndChooser), 0); |
| 50 } | 52 } |
| 51 | 53 |
| 52 void MockColorChooser::invokeDidEndChooser() | 54 void MockColorChooser::InvokeDidEndChooser() |
| 53 { | 55 { |
| 54 m_client->didEndChooser(); | 56 client_->didEndChooser(); |
| 55 } | 57 } |
| 56 | 58 |
| 57 } // namespace content | 59 } // namespace content |
| OLD | NEW |