OLD | NEW |
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 "extensions/browser/app_window/app_window.h" | 5 #include "extensions/browser/app_window/app_window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 inactive_frame_color(SK_ColorBLACK), | 164 inactive_frame_color(SK_ColorBLACK), |
165 alpha_enabled(false), | 165 alpha_enabled(false), |
166 is_ime_window(false), | 166 is_ime_window(false), |
167 creator_process_id(0), | 167 creator_process_id(0), |
168 state(ui::SHOW_STATE_DEFAULT), | 168 state(ui::SHOW_STATE_DEFAULT), |
169 hidden(false), | 169 hidden(false), |
170 resizable(true), | 170 resizable(true), |
171 focused(true), | 171 focused(true), |
172 always_on_top(false), | 172 always_on_top(false), |
173 visible_on_all_workspaces(false), | 173 visible_on_all_workspaces(false), |
| 174 show_on_lock_screen(false), |
174 show_in_shelf(false) {} | 175 show_in_shelf(false) {} |
175 | 176 |
176 AppWindow::CreateParams::CreateParams(const CreateParams& other) = default; | 177 AppWindow::CreateParams::CreateParams(const CreateParams& other) = default; |
177 | 178 |
178 AppWindow::CreateParams::~CreateParams() {} | 179 AppWindow::CreateParams::~CreateParams() {} |
179 | 180 |
180 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( | 181 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( |
181 const gfx::Insets& frame_insets) const { | 182 const gfx::Insets& frame_insets) const { |
182 // Combine into a single window bounds. | 183 // Combine into a single window bounds. |
183 gfx::Rect combined_bounds(window_spec.bounds); | 184 gfx::Rect combined_bounds(window_spec.bounds); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 : browser_context_(context), | 242 : browser_context_(context), |
242 extension_id_(extension->id()), | 243 extension_id_(extension->id()), |
243 window_type_(WINDOW_TYPE_DEFAULT), | 244 window_type_(WINDOW_TYPE_DEFAULT), |
244 app_delegate_(app_delegate), | 245 app_delegate_(app_delegate), |
245 fullscreen_types_(FULLSCREEN_TYPE_NONE), | 246 fullscreen_types_(FULLSCREEN_TYPE_NONE), |
246 has_been_shown_(false), | 247 has_been_shown_(false), |
247 is_hidden_(false), | 248 is_hidden_(false), |
248 cached_always_on_top_(false), | 249 cached_always_on_top_(false), |
249 requested_alpha_enabled_(false), | 250 requested_alpha_enabled_(false), |
250 is_ime_window_(false), | 251 is_ime_window_(false), |
| 252 show_on_lock_screen_(false), |
251 show_in_shelf_(false), | 253 show_in_shelf_(false), |
252 image_loader_ptr_factory_(this) { | 254 image_loader_ptr_factory_(this) { |
253 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); | 255 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); |
254 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord()) | 256 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord()) |
255 << "Only off the record window may be opened in the guest mode."; | 257 << "Only off the record window may be opened in the guest mode."; |
256 } | 258 } |
257 | 259 |
258 void AppWindow::Init(const GURL& url, | 260 void AppWindow::Init(const GURL& url, |
259 AppWindowContents* app_window_contents, | 261 AppWindowContents* app_window_contents, |
260 content::RenderFrameHost* creator_frame, | 262 content::RenderFrameHost* creator_frame, |
(...skipping 22 matching lines...) Expand all Loading... |
283 window_type_ = new_params.window_type; | 285 window_type_ = new_params.window_type; |
284 window_key_ = new_params.window_key; | 286 window_key_ = new_params.window_key; |
285 | 287 |
286 // Windows cannot be always-on-top in fullscreen mode for security reasons. | 288 // Windows cannot be always-on-top in fullscreen mode for security reasons. |
287 cached_always_on_top_ = new_params.always_on_top; | 289 cached_always_on_top_ = new_params.always_on_top; |
288 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) | 290 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) |
289 new_params.always_on_top = false; | 291 new_params.always_on_top = false; |
290 | 292 |
291 requested_alpha_enabled_ = new_params.alpha_enabled; | 293 requested_alpha_enabled_ = new_params.alpha_enabled; |
292 is_ime_window_ = params.is_ime_window; | 294 is_ime_window_ = params.is_ime_window; |
| 295 show_on_lock_screen_ = params.show_on_lock_screen; |
293 show_in_shelf_ = params.show_in_shelf; | 296 show_in_shelf_ = params.show_in_shelf; |
294 | 297 |
295 AppWindowClient* app_window_client = AppWindowClient::Get(); | 298 AppWindowClient* app_window_client = AppWindowClient::Get(); |
296 native_app_window_.reset( | 299 native_app_window_.reset( |
297 app_window_client->CreateNativeAppWindow(this, &new_params)); | 300 app_window_client->CreateNativeAppWindow(this, &new_params)); |
298 | 301 |
299 helper_.reset(new AppWebContentsHelper( | 302 helper_.reset(new AppWebContentsHelper( |
300 browser_context_, extension_id_, web_contents(), app_delegate_.get())); | 303 browser_context_, extension_id_, web_contents(), app_delegate_.get())); |
301 | 304 |
302 native_app_window_->UpdateWindowIcon(); | 305 native_app_window_->UpdateWindowIcon(); |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 region.bounds.x(), | 1044 region.bounds.x(), |
1042 region.bounds.y(), | 1045 region.bounds.y(), |
1043 region.bounds.right(), | 1046 region.bounds.right(), |
1044 region.bounds.bottom(), | 1047 region.bounds.bottom(), |
1045 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1048 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
1046 } | 1049 } |
1047 return sk_region; | 1050 return sk_region; |
1048 } | 1051 } |
1049 | 1052 |
1050 } // namespace extensions | 1053 } // namespace extensions |
OLD | NEW |