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

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 11147037: Add a 'hidden' option to chrome.app.window.create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ash tests Created 8 years, 2 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/app_window/app_window_api.h" 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/window_controller.h" 10 #include "chrome/browser/extensions/window_controller.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 create_params.bounds.width() > maximum_size.width()) 123 create_params.bounds.width() > maximum_size.width())
124 create_params.bounds.set_width(maximum_size.width()); 124 create_params.bounds.set_width(maximum_size.width());
125 if (create_params.bounds.width() < minimum_size.width()) 125 if (create_params.bounds.width() < minimum_size.width())
126 create_params.bounds.set_width(minimum_size.width()); 126 create_params.bounds.set_width(minimum_size.width());
127 127
128 if (maximum_size.height() && 128 if (maximum_size.height() &&
129 create_params.bounds.height() > maximum_size.height()) 129 create_params.bounds.height() > maximum_size.height())
130 create_params.bounds.set_height(maximum_size.height()); 130 create_params.bounds.set_height(maximum_size.height());
131 if (create_params.bounds.height() < minimum_size.height()) 131 if (create_params.bounds.height() < minimum_size.height())
132 create_params.bounds.set_height(minimum_size.height()); 132 create_params.bounds.set_height(minimum_size.height());
133
134 if (options->hidden.get())
135 create_params.hidden = *options->hidden.get();
133 } 136 }
134 137
135 create_params.creator_process_id = 138 create_params.creator_process_id =
136 render_view_host_->GetProcess()->GetID(); 139 render_view_host_->GetProcess()->GetID();
137 140
138 ShellWindow* shell_window = 141 ShellWindow* shell_window =
139 ShellWindow::Create(profile(), GetExtension(), url, create_params); 142 ShellWindow::Create(profile(), GetExtension(), url, create_params);
140 shell_window->GetBaseWindow()->Show();
141 143
142 content::RenderViewHost* created_view = 144 content::RenderViewHost* created_view =
143 shell_window->web_contents()->GetRenderViewHost(); 145 shell_window->web_contents()->GetRenderViewHost();
144 int view_id = MSG_ROUTING_NONE; 146 int view_id = MSG_ROUTING_NONE;
145 if (create_params.creator_process_id == created_view->GetProcess()->GetID()) 147 if (create_params.creator_process_id == created_view->GetProcess()->GetID())
146 view_id = created_view->GetRoutingID(); 148 view_id = created_view->GetRoutingID();
147 149
148 base::DictionaryValue* result = new base::DictionaryValue; 150 base::DictionaryValue* result = new base::DictionaryValue;
149 result->Set("viewId", base::Value::CreateIntegerValue(view_id)); 151 result->Set("viewId", base::Value::CreateIntegerValue(view_id));
150 result->Set("injectTitlebar", 152 result->Set("injectTitlebar",
151 base::Value::CreateBooleanValue(inject_html_titlebar)); 153 base::Value::CreateBooleanValue(inject_html_titlebar));
152 result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); 154 result->Set("id", base::Value::CreateStringValue(shell_window->window_key()));
153 SetResult(result); 155 SetResult(result);
154 return true; 156 return true;
155 } 157 }
156 158
157 } // namespace extensions 159 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698