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 active_frame_color(SK_ColorBLACK), | 164 active_frame_color(SK_ColorBLACK), |
165 inactive_frame_color(SK_ColorBLACK), | 165 inactive_frame_color(SK_ColorBLACK), |
166 alpha_enabled(false), | 166 alpha_enabled(false), |
167 is_ime_window(false), | 167 is_ime_window(false), |
168 creator_process_id(0), | 168 creator_process_id(0), |
169 state(ui::SHOW_STATE_DEFAULT), | 169 state(ui::SHOW_STATE_DEFAULT), |
170 hidden(false), | 170 hidden(false), |
171 resizable(true), | 171 resizable(true), |
172 focused(true), | 172 focused(true), |
173 always_on_top(false), | 173 always_on_top(false), |
174 visible_on_all_workspaces(false) { | 174 visible_on_all_workspaces(false), |
175 } | 175 show_in_shelf(false) {} |
176 | 176 |
177 AppWindow::CreateParams::CreateParams(const CreateParams& other) = default; | 177 AppWindow::CreateParams::CreateParams(const CreateParams& other) = default; |
178 | 178 |
179 AppWindow::CreateParams::~CreateParams() {} | 179 AppWindow::CreateParams::~CreateParams() {} |
180 | 180 |
181 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( | 181 gfx::Rect AppWindow::CreateParams::GetInitialWindowBounds( |
182 const gfx::Insets& frame_insets) const { | 182 const gfx::Insets& frame_insets) const { |
183 // Combine into a single window bounds. | 183 // Combine into a single window bounds. |
184 gfx::Rect combined_bounds(window_spec.bounds); | 184 gfx::Rect combined_bounds(window_spec.bounds); |
185 if (content_spec.bounds.x() != BoundsSpecification::kUnspecifiedPosition) | 185 if (content_spec.bounds.x() != BoundsSpecification::kUnspecifiedPosition) |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 fullscreen_types_(FULLSCREEN_TYPE_NONE), | 246 fullscreen_types_(FULLSCREEN_TYPE_NONE), |
247 show_on_first_paint_(false), | 247 show_on_first_paint_(false), |
248 first_paint_complete_(false), | 248 first_paint_complete_(false), |
249 has_been_shown_(false), | 249 has_been_shown_(false), |
250 can_send_events_(false), | 250 can_send_events_(false), |
251 is_hidden_(false), | 251 is_hidden_(false), |
252 delayed_show_type_(SHOW_ACTIVE), | 252 delayed_show_type_(SHOW_ACTIVE), |
253 cached_always_on_top_(false), | 253 cached_always_on_top_(false), |
254 requested_alpha_enabled_(false), | 254 requested_alpha_enabled_(false), |
255 is_ime_window_(false), | 255 is_ime_window_(false), |
256 show_in_shelf_(false), | |
256 image_loader_ptr_factory_(this) { | 257 image_loader_ptr_factory_(this) { |
257 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); | 258 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); |
258 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord()) | 259 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord()) |
259 << "Only off the record window may be opened in the guest mode."; | 260 << "Only off the record window may be opened in the guest mode."; |
260 } | 261 } |
261 | 262 |
262 void AppWindow::Init(const GURL& url, | 263 void AppWindow::Init(const GURL& url, |
263 AppWindowContents* app_window_contents, | 264 AppWindowContents* app_window_contents, |
264 content::RenderFrameHost* creator_frame, | 265 content::RenderFrameHost* creator_frame, |
265 const CreateParams& params) { | 266 const CreateParams& params) { |
(...skipping 23 matching lines...) Expand all Loading... | |
289 | 290 |
290 // Windows cannot be always-on-top in fullscreen mode for security reasons. | 291 // Windows cannot be always-on-top in fullscreen mode for security reasons. |
291 cached_always_on_top_ = new_params.always_on_top; | 292 cached_always_on_top_ = new_params.always_on_top; |
292 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) | 293 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) |
293 new_params.always_on_top = false; | 294 new_params.always_on_top = false; |
294 | 295 |
295 requested_alpha_enabled_ = new_params.alpha_enabled; | 296 requested_alpha_enabled_ = new_params.alpha_enabled; |
296 | 297 |
297 is_ime_window_ = params.is_ime_window; | 298 is_ime_window_ = params.is_ime_window; |
298 | 299 |
300 show_in_shelf_ = params.show_in_shelf; | |
stevenjb
2016/04/26 16:30:00
nit: no blank lines between these three lines.
Andra Paraschiv
2016/04/28 09:49:03
Done.
| |
301 | |
299 AppWindowClient* app_window_client = AppWindowClient::Get(); | 302 AppWindowClient* app_window_client = AppWindowClient::Get(); |
300 native_app_window_.reset( | 303 native_app_window_.reset( |
301 app_window_client->CreateNativeAppWindow(this, &new_params)); | 304 app_window_client->CreateNativeAppWindow(this, &new_params)); |
302 | 305 |
303 helper_.reset(new AppWebContentsHelper( | 306 helper_.reset(new AppWebContentsHelper( |
304 browser_context_, extension_id_, web_contents(), app_delegate_.get())); | 307 browser_context_, extension_id_, web_contents(), app_delegate_.get())); |
305 | 308 |
306 UpdateExtensionAppIcon(); | 309 UpdateExtensionAppIcon(); |
307 AppWindowRegistry::Get(browser_context_)->AddAppWindow(this); | 310 AppWindowRegistry::Get(browser_context_)->AddAppWindow(this); |
308 | 311 |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1117 region.bounds.x(), | 1120 region.bounds.x(), |
1118 region.bounds.y(), | 1121 region.bounds.y(), |
1119 region.bounds.right(), | 1122 region.bounds.right(), |
1120 region.bounds.bottom(), | 1123 region.bounds.bottom(), |
1121 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 1124 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
1122 } | 1125 } |
1123 return sk_region; | 1126 return sk_region; |
1124 } | 1127 } |
1125 | 1128 |
1126 } // namespace extensions | 1129 } // namespace extensions |
OLD | NEW |