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

Side by Side Diff: ui/views/widget/widget.cc

Issue 15240002: Cross-platform DefaultThemeProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comment. Created 7 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 | « ui/views/widget/widget.h ('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) 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/widget/widget.h" 5 #include "ui/views/widget/widget.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "ui/base/default_theme_provider.h"
11 #include "ui/base/events/event.h" 12 #include "ui/base/events/event.h"
12 #include "ui/base/hit_test.h" 13 #include "ui/base/hit_test.h"
13 #include "ui/base/l10n/l10n_font_util.h" 14 #include "ui/base/l10n/l10n_font_util.h"
14 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/compositor/compositor.h" 16 #include "ui/compositor/compositor.h"
16 #include "ui/compositor/layer.h" 17 #include "ui/compositor/layer.h"
17 #include "ui/gfx/screen.h" 18 #include "ui/gfx/screen.h"
18 #include "ui/views/focus/focus_manager.h" 19 #include "ui/views/focus/focus_manager.h"
19 #include "ui/views/focus/focus_manager_factory.h" 20 #include "ui/views/focus/focus_manager_factory.h"
20 #include "ui/views/focus/view_storage.h" 21 #include "ui/views/focus/view_storage.h"
21 #include "ui/views/focus/widget_focus_manager.h" 22 #include "ui/views/focus/widget_focus_manager.h"
22 #include "ui/views/ime/input_method.h" 23 #include "ui/views/ime/input_method.h"
23 #include "ui/views/views_delegate.h" 24 #include "ui/views/views_delegate.h"
24 #include "ui/views/widget/default_theme_provider.h"
25 #include "ui/views/widget/native_widget_private.h" 25 #include "ui/views/widget/native_widget_private.h"
26 #include "ui/views/widget/root_view.h" 26 #include "ui/views/widget/root_view.h"
27 #include "ui/views/widget/tooltip_manager.h" 27 #include "ui/views/widget/tooltip_manager.h"
28 #include "ui/views/widget/widget_delegate.h" 28 #include "ui/views/widget/widget_delegate.h"
29 #include "ui/views/widget/widget_deletion_observer.h" 29 #include "ui/views/widget/widget_deletion_observer.h"
30 #include "ui/views/widget/widget_observer.h" 30 #include "ui/views/widget/widget_observer.h"
31 #include "ui/views/window/custom_frame_view.h" 31 #include "ui/views/window/custom_frame_view.h"
32 32
33 #if !defined(OS_MACOSX) 33 #if !defined(OS_MACOSX)
34 #include "ui/views/controls/menu/menu_controller.h" 34 #include "ui/views/controls/menu/menu_controller.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 if (ViewsDelegate::views_delegate) 360 if (ViewsDelegate::views_delegate)
361 ViewsDelegate::views_delegate->OnBeforeWidgetInit(&params, this); 361 ViewsDelegate::views_delegate->OnBeforeWidgetInit(&params, this);
362 362
363 widget_delegate_ = params.delegate ? 363 widget_delegate_ = params.delegate ?
364 params.delegate : new DefaultWidgetDelegate(this, params); 364 params.delegate : new DefaultWidgetDelegate(this, params);
365 ownership_ = params.ownership; 365 ownership_ = params.ownership;
366 native_widget_ = CreateNativeWidget(params.native_widget, this)-> 366 native_widget_ = CreateNativeWidget(params.native_widget, this)->
367 AsNativeWidgetPrivate(); 367 AsNativeWidgetPrivate();
368 root_view_.reset(CreateRootView()); 368 root_view_.reset(CreateRootView());
369 default_theme_provider_.reset(new DefaultThemeProvider); 369 default_theme_provider_.reset(new ui::DefaultThemeProvider);
370 if (params.type == InitParams::TYPE_MENU) { 370 if (params.type == InitParams::TYPE_MENU) {
371 is_mouse_button_pressed_ = 371 is_mouse_button_pressed_ =
372 internal::NativeWidgetPrivate::IsMouseButtonDown(); 372 internal::NativeWidgetPrivate::IsMouseButtonDown();
373 } 373 }
374 native_widget_->InitNativeWidget(params); 374 native_widget_->InitNativeWidget(params);
375 if (RequiresNonClientView(params.type)) { 375 if (RequiresNonClientView(params.type)) {
376 non_client_view_ = new NonClientView; 376 non_client_view_ = new NonClientView;
377 non_client_view_->SetFrameView(CreateNonClientFrameView()); 377 non_client_view_->SetFrameView(CreateNonClientFrameView());
378 // Create the ClientView, add it to the NonClientView and add the 378 // Create the ClientView, add it to the NonClientView and add the
379 // NonClientView to the RootView. This will cause everything to be parented. 379 // NonClientView to the RootView. This will cause everything to be parented.
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1410 1410
1411 //////////////////////////////////////////////////////////////////////////////// 1411 ////////////////////////////////////////////////////////////////////////////////
1412 // internal::NativeWidgetPrivate, NativeWidget implementation: 1412 // internal::NativeWidgetPrivate, NativeWidget implementation:
1413 1413
1414 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1414 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1415 return this; 1415 return this;
1416 } 1416 }
1417 1417
1418 } // namespace internal 1418 } // namespace internal
1419 } // namespace views 1419 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698