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

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;
33 params.theme_provider = ThemeServiceFactory::GetForProfile(
34 ProfileManager::GetActiveUserProfile());
oshima 2015/09/02 18:44:12 You should get the profile associated with the par
jonross 2015/09/09 14:54:36 I have switched to using MultiUserWindowManager, h
30 35
31 widget->Init(params); 36 widget->Init(params);
32 return widget; 37 return widget;
33 } 38 }
34 39
35 } // namespace 40 } // namespace
36 41
37 namespace chromeos { 42 namespace chromeos {
38 43
39 CaptivePortalWindowProxy::CaptivePortalWindowProxy( 44 CaptivePortalWindowProxy::CaptivePortalWindowProxy(
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 } 158 }
154 159
155 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) { 160 void CaptivePortalWindowProxy::DetachFromWidget(views::Widget* widget) {
156 if (!widget_ || widget_ != widget) 161 if (!widget_ || widget_ != widget)
157 return; 162 return;
158 widget_->RemoveObserver(this); 163 widget_->RemoveObserver(this);
159 widget_ = NULL; 164 widget_ = NULL;
160 } 165 }
161 166
162 } // namespace chromeos 167 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698