OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |