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

Side by Side Diff: views/window/window.cc

Issue 7069022: Adds a basic NativeWindowViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « views/window/native_window_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/window/window.h" 5 #include "views/window/window.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "third_party/skia/include/core/SkBitmap.h" 9 #include "third_party/skia/include/core/SkBitmap.h"
10 #include "ui/base/l10n/l10n_font_util.h" 10 #include "ui/base/l10n/l10n_font_util.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/gfx/font.h" 12 #include "ui/gfx/font.h"
13 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/size.h" 14 #include "ui/gfx/size.h"
15 #include "views/widget/widget.h" 15 #include "views/widget/widget.h"
16 #include "views/widget/native_widget.h" 16 #include "views/widget/native_widget.h"
17 #include "views/window/custom_frame_view.h"
17 #include "views/window/native_window.h" 18 #include "views/window/native_window.h"
18 #include "views/window/window_delegate.h" 19 #include "views/window/window_delegate.h"
19 20
20 namespace views { 21 namespace views {
21 22
22 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
23 // Window, public: 24 // Window, public:
24 25
25 Window::InitParams::InitParams(WindowDelegate* window_delegate) 26 Window::InitParams::InitParams(WindowDelegate* window_delegate)
26 : window_delegate(window_delegate), 27 : window_delegate(window_delegate),
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 non_client_view_->UpdateWindowIcon(); 223 non_client_view_->UpdateWindowIcon();
223 native_window_->SetWindowIcons(window_delegate_->GetWindowIcon(), 224 native_window_->SetWindowIcons(window_delegate_->GetWindowIcon(),
224 window_delegate_->GetWindowAppIcon()); 225 window_delegate_->GetWindowAppIcon());
225 } 226 }
226 227
227 void Window::SetIsAlwaysOnTop(bool always_on_top) { 228 void Window::SetIsAlwaysOnTop(bool always_on_top) {
228 native_window_->SetAlwaysOnTop(always_on_top); 229 native_window_->SetAlwaysOnTop(always_on_top);
229 } 230 }
230 231
231 NonClientFrameView* Window::CreateFrameViewForWindow() { 232 NonClientFrameView* Window::CreateFrameViewForWindow() {
232 return native_window_->CreateFrameViewForWindow(); 233 NonClientFrameView* frame_view = native_window_->CreateFrameViewForWindow();
234 return frame_view ? frame_view : new CustomFrameView(this);
233 } 235 }
234 236
235 void Window::UpdateFrameAfterFrameChange() { 237 void Window::UpdateFrameAfterFrameChange() {
236 native_window_->UpdateFrameAfterFrameChange(); 238 native_window_->UpdateFrameAfterFrameChange();
237 } 239 }
238 240
239 gfx::NativeWindow Window::GetNativeWindow() const { 241 gfx::NativeWindow Window::GetNativeWindow() const {
240 return native_window_->GetNativeWindow(); 242 return native_window_->GetNativeWindow();
241 } 243 }
242 244
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 if (!window_delegate_) 410 if (!window_delegate_)
409 return; 411 return;
410 412
411 bool maximized; 413 bool maximized;
412 gfx::Rect bounds; 414 gfx::Rect bounds;
413 native_window_->GetWindowBoundsAndMaximizedState(&bounds, &maximized); 415 native_window_->GetWindowBoundsAndMaximizedState(&bounds, &maximized);
414 window_delegate_->SaveWindowPlacement(bounds, maximized); 416 window_delegate_->SaveWindowPlacement(bounds, maximized);
415 } 417 }
416 418
417 } // namespace views 419 } // namespace views
OLDNEW
« no previous file with comments | « views/window/native_window_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698