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

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: rename 'createHidden' to 'hidden' for less redundancy 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 create_params.bounds.width() > maximum_size.width()) 115 create_params.bounds.width() > maximum_size.width())
116 create_params.bounds.set_width(maximum_size.width()); 116 create_params.bounds.set_width(maximum_size.width());
117 if (create_params.bounds.width() < minimum_size.width()) 117 if (create_params.bounds.width() < minimum_size.width())
118 create_params.bounds.set_width(minimum_size.width()); 118 create_params.bounds.set_width(minimum_size.width());
119 119
120 if (maximum_size.height() && 120 if (maximum_size.height() &&
121 create_params.bounds.height() > maximum_size.height()) 121 create_params.bounds.height() > maximum_size.height())
122 create_params.bounds.set_height(maximum_size.height()); 122 create_params.bounds.set_height(maximum_size.height());
123 if (create_params.bounds.height() < minimum_size.height()) 123 if (create_params.bounds.height() < minimum_size.height())
124 create_params.bounds.set_height(minimum_size.height()); 124 create_params.bounds.set_height(minimum_size.height());
125
126 if (options->hidden.get())
127 create_params.hidden = *options->create_hidden.get();
125 } 128 }
126 ShellWindow* shell_window = 129 ShellWindow* shell_window =
127 ShellWindow::Create(profile(), GetExtension(), url, create_params); 130 ShellWindow::Create(profile(), GetExtension(), url, create_params);
128 shell_window->GetBaseWindow()->Show(); 131 if (!create_params.hidden)
132 shell_window->GetBaseWindow()->Show();
129 133
130 content::WebContents* created_contents = shell_window->web_contents(); 134 content::WebContents* created_contents = shell_window->web_contents();
131 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); 135 int view_id = created_contents->GetRenderViewHost()->GetRoutingID();
132 136
133 base::DictionaryValue* result = new base::DictionaryValue; 137 base::DictionaryValue* result = new base::DictionaryValue;
134 result->Set("viewId", base::Value::CreateIntegerValue(view_id)); 138 result->Set("viewId", base::Value::CreateIntegerValue(view_id));
135 result->Set("injectTitlebar", 139 result->Set("injectTitlebar",
136 base::Value::CreateBooleanValue(inject_html_titlebar)); 140 base::Value::CreateBooleanValue(inject_html_titlebar));
137 result->Set("id", base::Value::CreateStringValue(shell_window->window_key())); 141 result->Set("id", base::Value::CreateStringValue(shell_window->window_key()));
138 SetResult(result); 142 SetResult(result);
139 return true; 143 return true;
140 } 144 }
141 145
142 } // namespace extensions 146 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698