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

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

Issue 7744045: Show a Window in the aura views demo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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
« no previous file with comments | « views/widget/widget.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/custom_frame_view.h" 5 #include "views/window/custom_frame_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
11 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
12 #include "ui/gfx/canvas.h" 12 #include "ui/gfx/canvas.h"
13 #include "ui/gfx/font.h" 13 #include "ui/gfx/font.h"
14 #include "ui/gfx/path.h" 14 #include "ui/gfx/path.h"
15 #include "views/widget/widget_delegate.h" 15 #include "views/widget/widget_delegate.h"
16 #include "views/window/client_view.h" 16 #include "views/window/client_view.h"
17 #include "views/window/window_shape.h" 17 #include "views/window/window_shape.h"
18 18
19 #if defined(OS_LINUX) 19 #if defined(OS_LINUX)
20 #include "views/window/hit_test.h" 20 #include "views/window/hit_test.h"
21 #endif 21 #endif
22 22
23 #if defined(OS_WIN) && !defined(USE_AURA) 23 #if defined(USE_AURA)
24 #include "views/widget/native_widget_aura.h"
25 #elif defined(OS_WIN)
24 #include "views/widget/native_widget_win.h" 26 #include "views/widget/native_widget_win.h"
25 #endif 27 #endif
26 28
27 namespace views { 29 namespace views {
28 30
29 // static 31 // static
30 gfx::Font* CustomFrameView::title_font_ = NULL; 32 gfx::Font* CustomFrameView::title_font_ = NULL;
31 33
32 namespace { 34 namespace {
33 // The frame border is only visible in restored mode and is hardcoded to 4 px on 35 // The frame border is only visible in restored mode and is hardcoded to 4 px on
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 int border_thickness = NonClientBorderThickness(); 562 int border_thickness = NonClientBorderThickness();
561 client_view_bounds_.SetRect(border_thickness, top_height, 563 client_view_bounds_.SetRect(border_thickness, top_height,
562 std::max(0, width() - (2 * border_thickness)), 564 std::max(0, width() - (2 * border_thickness)),
563 std::max(0, height() - top_height - border_thickness)); 565 std::max(0, height() - top_height - border_thickness));
564 } 566 }
565 567
566 // static 568 // static
567 void CustomFrameView::InitClass() { 569 void CustomFrameView::InitClass() {
568 static bool initialized = false; 570 static bool initialized = false;
569 if (!initialized) { 571 if (!initialized) {
570 #if defined(OS_WIN) && !defined(USE_AURA) 572 #if defined(USE_AURA)
573 title_font_ = new gfx::Font(NativeWidgetAura::GetWindowTitleFont());
574 #elif defined(OS_WIN)
571 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); 575 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont());
572 #elif defined(OS_LINUX) 576 #elif defined(OS_LINUX)
573 // TODO(ben): need to resolve what font this is. 577 // TODO(ben): need to resolve what font this is.
574 title_font_ = new gfx::Font(); 578 title_font_ = new gfx::Font();
575 #endif 579 #endif
576 initialized = true; 580 initialized = true;
577 } 581 }
578 } 582 }
579 583
580 } // namespace views 584 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698