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

Side by Side Diff: content/shell/shell_aura.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 "content/shell/shell.h" 5 #include "content/shell/shell.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/aura/desktop/desktop_screen.h" 8 #include "ui/aura/desktop/desktop_screen.h"
9 #include "ui/aura/desktop/desktop_stacking_client.h" 9 #include "ui/aura/desktop/desktop_stacking_client.h"
10 #include "ui/aura/display_manager.h" 10 #include "ui/aura/display_manager.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 virtual ~ShellViewsDelegateAura() { 46 virtual ~ShellViewsDelegateAura() {
47 ViewsDelegate::views_delegate = NULL; 47 ViewsDelegate::views_delegate = NULL;
48 } 48 }
49 49
50 void SetUseTransparentWindows(bool transparent) { 50 void SetUseTransparentWindows(bool transparent) {
51 use_transparent_windows_ = transparent; 51 use_transparent_windows_ = transparent;
52 } 52 }
53 53
54 // Overridden from ViewsDelegate: 54 // Overridden from ViewsDelegate:
55 virtual ui::Clipboard* GetClipboard() const OVERRIDE {
56 if (!clipboard_.get()) {
57 clipboard_.reset(new ui::Clipboard);
58 }
59 return clipboard_.get();
60 }
61
62 virtual void SaveWindowPlacement(const Widget* window, 55 virtual void SaveWindowPlacement(const Widget* window,
63 const std::string& window_name, 56 const std::string& window_name,
64 const gfx::Rect& bounds, 57 const gfx::Rect& bounds,
65 ui::WindowShowState show_state) OVERRIDE { 58 ui::WindowShowState show_state) OVERRIDE {
66 } 59 }
67 60
68 virtual bool GetSavedWindowPlacement( 61 virtual bool GetSavedWindowPlacement(
69 const std::string& window_name, 62 const std::string& window_name,
70 gfx::Rect* bounds, 63 gfx::Rect* bounds,
71 ui::WindowShowState* show_state) const OVERRIDE { 64 ui::WindowShowState* show_state) const OVERRIDE {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return new views::DesktopNativeWidgetHelperAura(native_widget); 97 return new views::DesktopNativeWidgetHelperAura(native_widget);
105 } 98 }
106 99
107 virtual content::WebContents* CreateWebContents( 100 virtual content::WebContents* CreateWebContents(
108 content::BrowserContext* browser_context, 101 content::BrowserContext* browser_context,
109 content::SiteInstance* site_instance) OVERRIDE { 102 content::SiteInstance* site_instance) OVERRIDE {
110 return NULL; 103 return NULL;
111 } 104 }
112 105
113 private: 106 private:
114 mutable scoped_ptr<ui::Clipboard> clipboard_;
115 bool use_transparent_windows_; 107 bool use_transparent_windows_;
116 108
117 DISALLOW_COPY_AND_ASSIGN(ShellViewsDelegateAura); 109 DISALLOW_COPY_AND_ASSIGN(ShellViewsDelegateAura);
118 }; 110 };
119 111
120 // Maintain the UI controls and web view for content shell 112 // Maintain the UI controls and web view for content shell
121 class ShellWindowDelegateView : public WidgetDelegateView, 113 class ShellWindowDelegateView : public WidgetDelegateView,
122 public TextfieldController, 114 public TextfieldController,
123 public ButtonListener { 115 public ButtonListener {
124 public: 116 public:
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 } 392 }
401 393
402 void Shell::PlatformSetTitle(const string16& title) { 394 void Shell::PlatformSetTitle(const string16& title) {
403 ShellWindowDelegateView* delegate_view = 395 ShellWindowDelegateView* delegate_view =
404 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); 396 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate());
405 delegate_view->SetWindowTitle(title); 397 delegate_view->SetWindowTitle(title);
406 window_widget_->UpdateWindowTitle(); 398 window_widget_->UpdateWindowTitle();
407 } 399 }
408 400
409 } // namespace content 401 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698