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

Side by Side Diff: ui/views/test/test_views_delegate.cc

Issue 10911074: Change how ui::Clipboard is accessed so there's only one per thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix various windows compile failures. Created 8 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/test/test_views_delegate.h" 5 #include "ui/views/test/test_views_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/test/web_contents_tester.h" 8 #include "content/public/test/web_contents_tester.h"
9 #include "ui/base/clipboard/clipboard.h"
10 9
11 namespace views { 10 namespace views {
12 11
13 TestViewsDelegate::TestViewsDelegate() 12 TestViewsDelegate::TestViewsDelegate()
14 : use_transparent_windows_(false) { 13 : use_transparent_windows_(false) {
15 DCHECK(!ViewsDelegate::views_delegate); 14 DCHECK(!ViewsDelegate::views_delegate);
16 ViewsDelegate::views_delegate = this; 15 ViewsDelegate::views_delegate = this;
17 } 16 }
18 17
19 TestViewsDelegate::~TestViewsDelegate() { 18 TestViewsDelegate::~TestViewsDelegate() {
20 ViewsDelegate::views_delegate = NULL; 19 ViewsDelegate::views_delegate = NULL;
21 } 20 }
22 21
23 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) { 22 void TestViewsDelegate::SetUseTransparentWindows(bool transparent) {
24 use_transparent_windows_ = transparent; 23 use_transparent_windows_ = transparent;
25 } 24 }
26 25
27 ui::Clipboard* TestViewsDelegate::GetClipboard() const {
28 if (!clipboard_.get()) {
29 // Note that we need a MessageLoop for the next call to work.
30 clipboard_.reset(new ui::Clipboard);
31 }
32 return clipboard_.get();
33 }
34
35 void TestViewsDelegate::SaveWindowPlacement(const Widget* window, 26 void TestViewsDelegate::SaveWindowPlacement(const Widget* window,
36 const std::string& window_name, 27 const std::string& window_name,
37 const gfx::Rect& bounds, 28 const gfx::Rect& bounds,
38 ui::WindowShowState show_state) { 29 ui::WindowShowState show_state) {
39 } 30 }
40 31
41 bool TestViewsDelegate::GetSavedWindowPlacement( 32 bool TestViewsDelegate::GetSavedWindowPlacement(
42 const std::string& window_name, 33 const std::string& window_name,
43 gfx::Rect* bounds, 34 gfx::Rect* bounds,
44 ui:: WindowShowState* show_state) const { 35 ui:: WindowShowState* show_state) const {
(...skipping 20 matching lines...) Expand all
65 } 56 }
66 #endif 57 #endif
67 58
68 content::WebContents* TestViewsDelegate::CreateWebContents( 59 content::WebContents* TestViewsDelegate::CreateWebContents(
69 content::BrowserContext* browser_context, 60 content::BrowserContext* browser_context,
70 content::SiteInstance* site_instance) { 61 content::SiteInstance* site_instance) {
71 return NULL; 62 return NULL;
72 } 63 }
73 64
74 } // namespace views 65 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698