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

Side by Side Diff: chrome/browser/chromeos/login/background_view.cc

Issue 7945014: Applied review comments from oshima for CL 7850026. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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
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 "chrome/browser/chromeos/login/background_view.h" 5 #include "chrome/browser/chromeos/login/background_view.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 shutdown_button_ = NULL; 122 shutdown_button_ = NULL;
123 SchedulePaint(); 123 SchedulePaint();
124 } 124 }
125 } 125 }
126 126
127 // static 127 // static
128 views::Widget* BackgroundView::CreateWindowContainingView( 128 views::Widget* BackgroundView::CreateWindowContainingView(
129 const gfx::Rect& bounds, 129 const gfx::Rect& bounds,
130 const GURL& background_url, 130 const GURL& background_url,
131 BackgroundView** view) { 131 BackgroundView** view) {
132 #if defined(USE_AURA)
133 // TODO(saintlou):
134 return NULL;
135 #else
oshima 2011/09/19 22:31:03 would it be possible to compile & link only webui
Emmanuel Saint-loubert-Bié 2011/09/19 23:26:02 That would be the goal. I am not sure we are ready
oshima 2011/09/20 04:59:17 webui oobe/login has been enabled for chromeos, so
136 Widget* window = new Widget; 132 Widget* window = new Widget;
137 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW_FRAMELESS); 133 Widget::InitParams params(Widget::InitParams::TYPE_WINDOW_FRAMELESS);
138 params.bounds = bounds; 134 params.bounds = bounds;
139 window->Init(params); 135 window->Init(params);
140 *view = new BackgroundView(); 136 *view = new BackgroundView();
141 (*view)->Init(background_url); 137 (*view)->Init(background_url);
142 138
143 if ((*view)->ScreenSaverEnabled()) 139 if ((*view)->ScreenSaverEnabled())
144 (*view)->ShowScreenSaver(); 140 (*view)->ShowScreenSaver();
145 141
146 window->SetContentsView(*view); 142 window->SetContentsView(*view);
147 143
148 (*view)->UpdateWindowType(); 144 (*view)->UpdateWindowType();
149 145
150 // This keeps the window from flashing at startup. 146 // This keeps the window from flashing at startup.
151 GdkWindow* gdk_window = window->GetNativeView()->window; 147 GdkWindow* gdk_window = window->GetNativeView()->window;
152 gdk_window_set_back_pixmap(gdk_window, NULL, false); 148 gdk_window_set_back_pixmap(gdk_window, NULL, false);
153 149
154 LoginUtils::Get()->SetBackgroundView(*view); 150 LoginUtils::Get()->SetBackgroundView(*view);
155 151
156 return window; 152 return window;
157 #endif
158 } 153 }
159 154
160 void BackgroundView::CreateModalPopup(views::WidgetDelegate* view) { 155 void BackgroundView::CreateModalPopup(views::WidgetDelegate* view) {
161 views::Widget* window = browser::CreateViewsWindow( 156 views::Widget* window = browser::CreateViewsWindow(
162 GetNativeWindow(), view); 157 GetNativeWindow(), view);
163 window->SetAlwaysOnTop(true); 158 window->SetAlwaysOnTop(true);
164 window->Show(); 159 window->Show();
165 } 160 }
166 161
167 gfx::NativeWindow BackgroundView::GetNativeWindow() const { 162 gfx::NativeWindow BackgroundView::GetNativeWindow() const {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 381
387 void BackgroundView::UpdateWindowType() { 382 void BackgroundView::UpdateWindowType() {
388 std::vector<int> params; 383 std::vector<int> params;
389 WmIpc::instance()->SetWindowType( 384 WmIpc::instance()->SetWindowType(
390 GTK_WIDGET(GetNativeWindow()), 385 GTK_WIDGET(GetNativeWindow()),
391 WM_IPC_WINDOW_LOGIN_BACKGROUND, 386 WM_IPC_WINDOW_LOGIN_BACKGROUND,
392 &params); 387 &params);
393 } 388 }
394 389
395 } // namespace chromeos 390 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698