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

Side by Side Diff: chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc

Issue 1310183009: Add ability for Widgets to override the DefaultThemeProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" 5 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h" 8 #include "chrome/browser/chromeos/login/ui/captive_portal_view.h"
9 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" 9 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h"
10 #include "chrome/browser/chromeos/profiles/profile_helper.h" 10 #include "chrome/browser/chromeos/profiles/profile_helper.h"
11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/themes/theme_service.h"
13 #include "chrome/browser/themes/theme_service_factory.h"
11 #include "components/web_modal/web_contents_modal_dialog_host.h" 14 #include "components/web_modal/web_contents_modal_dialog_host.h"
12 #include "components/web_modal/web_contents_modal_dialog_manager.h" 15 #include "components/web_modal/web_contents_modal_dialog_manager.h"
13 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 16 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
14 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
15 18
16 namespace { 19 namespace {
17 20
18 // The captive portal dialog is system-modal, but uses the web-content-modal 21 // The captive portal dialog is system-modal, but uses the web-content-modal
19 // dialog manager (odd) and requires this atypical dialog widget initialization. 22 // dialog manager (odd) and requires this atypical dialog widget initialization.
20 views::Widget* CreateWindowAsFramelessChild(views::WidgetDelegate* delegate, 23 views::Widget* CreateWindowAsFramelessChild(views::WidgetDelegate* delegate,
21 gfx::NativeView parent) { 24 gfx::NativeView parent) {
22 views::Widget* widget = new views::Widget; 25 views::Widget* widget = new views::Widget;
23 26
24 views::Widget::InitParams params; 27 views::Widget::InitParams params;
25 params.delegate = delegate; 28 params.delegate = delegate;
26 params.child = true; 29 params.child = true;
27 params.parent = parent; 30 params.parent = parent;
28 params.remove_standard_frame = true; 31 params.remove_standard_frame = true;
29 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 32 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
30 33
31 widget->Init(params); 34 widget->Init(params);
35
36 widget->SetThemeProvider(ThemeServiceFactory::GetForProfile(
37 ProfileManager::GetActiveUserProfile()));
38
32 return widget; 39 return widget;
33 } 40 }
34 41
35 } // namespace 42 } // namespace
36 43
37 namespace chromeos { 44 namespace chromeos {
38 45
39 CaptivePortalWindowProxy::CaptivePortalWindowProxy( 46 CaptivePortalWindowProxy::CaptivePortalWindowProxy(
40 Delegate* delegate, 47 Delegate* delegate,
41 content::WebContents* web_contents) 48 content::WebContents* web_contents)
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 160 }
154 161
155 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { 162 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) {
156 if (!widget_ || widget_ != widget) 163 if (!widget_ || widget_ != widget)
157 return; 164 return;
158 widget_->RemoveObserver(this); 165 widget_->RemoveObserver(this);
159 widget_ = NULL; 166 widget_ = NULL;
160 } 167 }
161 168
162 } // namespace chromeos 169 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc » ('j') | ui/views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698