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

Side by Side Diff: extensions/browser/app_window/app_window.cc

Issue 2738373002: Enhance chrome.app.window API with window background color (Closed)
Patch Set: Created 3 years, 9 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 "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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 // AppWindow::CreateParams 158 // AppWindow::CreateParams
159 159
160 AppWindow::CreateParams::CreateParams() 160 AppWindow::CreateParams::CreateParams()
161 : window_type(AppWindow::WINDOW_TYPE_DEFAULT), 161 : window_type(AppWindow::WINDOW_TYPE_DEFAULT),
162 frame(AppWindow::FRAME_CHROME), 162 frame(AppWindow::FRAME_CHROME),
163 has_frame_color(false), 163 has_frame_color(false),
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 background_color(SK_ColorWHITE),
167 is_ime_window(false), 168 is_ime_window(false),
168 creator_process_id(0), 169 creator_process_id(0),
169 state(ui::SHOW_STATE_DEFAULT), 170 state(ui::SHOW_STATE_DEFAULT),
170 hidden(false), 171 hidden(false),
171 resizable(true), 172 resizable(true),
172 focused(true), 173 focused(true),
173 always_on_top(false), 174 always_on_top(false),
174 visible_on_all_workspaces(false), 175 visible_on_all_workspaces(false),
175 show_in_shelf(false) {} 176 show_in_shelf(false) {}
176 177
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const Extension* extension) 242 const Extension* extension)
242 : browser_context_(context), 243 : browser_context_(context),
243 extension_id_(extension->id()), 244 extension_id_(extension->id()),
244 window_type_(WINDOW_TYPE_DEFAULT), 245 window_type_(WINDOW_TYPE_DEFAULT),
245 app_delegate_(app_delegate), 246 app_delegate_(app_delegate),
246 fullscreen_types_(FULLSCREEN_TYPE_NONE), 247 fullscreen_types_(FULLSCREEN_TYPE_NONE),
247 has_been_shown_(false), 248 has_been_shown_(false),
248 is_hidden_(false), 249 is_hidden_(false),
249 cached_always_on_top_(false), 250 cached_always_on_top_(false),
250 requested_alpha_enabled_(false), 251 requested_alpha_enabled_(false),
252 background_color_(SK_ColorWHITE),
251 is_ime_window_(false), 253 is_ime_window_(false),
252 show_in_shelf_(false), 254 show_in_shelf_(false),
253 image_loader_ptr_factory_(this) { 255 image_loader_ptr_factory_(this) {
254 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); 256 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get();
255 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord()) 257 CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord())
256 << "Only off the record window may be opened in the guest mode."; 258 << "Only off the record window may be opened in the guest mode.";
257 } 259 }
258 260
259 void AppWindow::Init(const GURL& url, 261 void AppWindow::Init(const GURL& url,
260 AppWindowContents* app_window_contents, 262 AppWindowContents* app_window_contents,
(...skipping 22 matching lines...) Expand all
283 CreateParams new_params = LoadDefaults(params); 285 CreateParams new_params = LoadDefaults(params);
284 window_type_ = new_params.window_type; 286 window_type_ = new_params.window_type;
285 window_key_ = new_params.window_key; 287 window_key_ = new_params.window_key;
286 288
287 // Windows cannot be always-on-top in fullscreen mode for security reasons. 289 // Windows cannot be always-on-top in fullscreen mode for security reasons.
288 cached_always_on_top_ = new_params.always_on_top; 290 cached_always_on_top_ = new_params.always_on_top;
289 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) 291 if (new_params.state == ui::SHOW_STATE_FULLSCREEN)
290 new_params.always_on_top = false; 292 new_params.always_on_top = false;
291 293
292 requested_alpha_enabled_ = new_params.alpha_enabled; 294 requested_alpha_enabled_ = new_params.alpha_enabled;
295 background_color_ = new_params.background_color;
293 is_ime_window_ = params.is_ime_window; 296 is_ime_window_ = params.is_ime_window;
294 show_in_shelf_ = params.show_in_shelf; 297 show_in_shelf_ = params.show_in_shelf;
295 window_icon_url_ = params.window_icon_url; 298 window_icon_url_ = params.window_icon_url;
296 299
297 AppWindowClient* app_window_client = AppWindowClient::Get(); 300 AppWindowClient* app_window_client = AppWindowClient::Get();
298 native_app_window_.reset( 301 native_app_window_.reset(
299 app_window_client->CreateNativeAppWindow(this, &new_params)); 302 app_window_client->CreateNativeAppWindow(this, &new_params));
300 303
301 helper_.reset(new AppWebContentsHelper( 304 helper_.reset(new AppWebContentsHelper(
302 browser_context_, extension_id_, web_contents(), app_delegate_.get())); 305 browser_context_, extension_id_, web_contents(), app_delegate_.get()));
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 region.bounds.x(), 1116 region.bounds.x(),
1114 region.bounds.y(), 1117 region.bounds.y(),
1115 region.bounds.right(), 1118 region.bounds.right(),
1116 region.bounds.bottom(), 1119 region.bounds.bottom(),
1117 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1120 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1118 } 1121 }
1119 return sk_region; 1122 return sk_region;
1120 } 1123 }
1121 1124
1122 } // namespace extensions 1125 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698