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

Side by Side Diff: content/shell/renderer/test_runner/MockColorChooser.cpp

Issue 279403006: Update WebFrameTestProxy and WebTestProxy to mostly follow Chrome style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/MockColorChooser.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/WebTestProxy.h" 8 #include "content/shell/renderer/test_runner/web_test_proxy.h"
9 9
10 using namespace blink; 10 using namespace blink;
11 using namespace std; 11 using namespace std;
12 12
13 namespace content { 13 namespace content {
14 14
15 namespace { 15 namespace {
16 class HostMethodTask : public WebMethodTask<MockColorChooser> { 16 class HostMethodTask : public WebMethodTask<MockColorChooser> {
17 public: 17 public:
18 typedef void (MockColorChooser::*CallbackMethodType)(); 18 typedef void (MockColorChooser::*CallbackMethodType)();
19 HostMethodTask(MockColorChooser* object, CallbackMethodType callback) 19 HostMethodTask(MockColorChooser* object, CallbackMethodType callback)
20 : WebMethodTask<MockColorChooser>(object) 20 : WebMethodTask<MockColorChooser>(object)
21 , m_callback(callback) 21 , m_callback(callback)
22 { } 22 { }
23 23
24 virtual void runIfValid() OVERRIDE { (m_object->*m_callback)(); } 24 virtual void runIfValid() OVERRIDE { (m_object->*m_callback)(); }
25 25
26 private: 26 private:
27 CallbackMethodType m_callback; 27 CallbackMethodType m_callback;
28 }; 28 };
29 } 29 }
30 30
31 MockColorChooser::MockColorChooser(blink::WebColorChooserClient* client, WebTest Delegate* delegate, WebTestProxyBase* proxy) 31 MockColorChooser::MockColorChooser(blink::WebColorChooserClient* client, WebTest Delegate* delegate, WebTestProxyBase* proxy)
32 : m_client(client) 32 : m_client(client)
33 , m_delegate(delegate) 33 , m_delegate(delegate)
34 , m_proxy(proxy) 34 , m_proxy(proxy)
35 { 35 {
36 m_proxy->didOpenChooser(); 36 m_proxy->DidOpenChooser();
37 } 37 }
38 38
39 MockColorChooser::~MockColorChooser() 39 MockColorChooser::~MockColorChooser()
40 { 40 {
41 m_proxy->didCloseChooser(); 41 m_proxy->DidCloseChooser();
42 } 42 }
43 43
44 void MockColorChooser::setSelectedColor(const blink::WebColor) 44 void MockColorChooser::setSelectedColor(const blink::WebColor)
45 { 45 {
46 } 46 }
47 47
48 void MockColorChooser::endChooser() 48 void MockColorChooser::endChooser()
49 { 49 {
50 m_delegate->postDelayedTask(new HostMethodTask(this, &MockColorChooser::invo keDidEndChooser), 0); 50 m_delegate->postDelayedTask(new HostMethodTask(this, &MockColorChooser::invo keDidEndChooser), 0);
51 } 51 }
52 52
53 void MockColorChooser::invokeDidEndChooser() 53 void MockColorChooser::invokeDidEndChooser()
54 { 54 {
55 m_client->didEndChooser(); 55 m_client->didEndChooser();
56 } 56 }
57 57
58 } // namespace content 58 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/test_runner/MockColorChooser.h ('k') | content/shell/renderer/test_runner/MockWebMIDIAccessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698