OLD | NEW |
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/time.h" | 7 #include "base/time.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/window_controller.h" | 9 #include "chrome/browser/extensions/window_controller.h" |
10 #include "chrome/browser/ui/extensions/shell_window.h" | 10 #include "chrome/browser/ui/extensions/shell_window.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 if (options->left.get() || options->top.get()) { | 71 if (options->left.get() || options->top.get()) { |
72 if (options->left.get()) | 72 if (options->left.get()) |
73 create_params.bounds.set_x(*options->left.get()); | 73 create_params.bounds.set_x(*options->left.get()); |
74 if (options->top.get()) | 74 if (options->top.get()) |
75 create_params.bounds.set_y(*options->top.get()); | 75 create_params.bounds.set_y(*options->top.get()); |
76 create_params.restore_position = false; | 76 create_params.restore_position = false; |
77 } | 77 } |
78 | 78 |
79 if (options->frame.get()) { | |
80 create_params.frame = *options->frame == kNoneFrameOption ? | |
81 ShellWindow::CreateParams::FRAME_NONE : | |
82 ShellWindow::CreateParams::FRAME_CHROME; | |
83 } | |
84 | |
85 gfx::Size& minimum_size = create_params.minimum_size; | 79 gfx::Size& minimum_size = create_params.minimum_size; |
86 if (options->min_width.get()) | 80 if (options->min_width.get()) |
87 minimum_size.set_width(*options->min_width); | 81 minimum_size.set_width(*options->min_width); |
88 if (options->min_height.get()) | 82 if (options->min_height.get()) |
89 minimum_size.set_height(*options->min_height); | 83 minimum_size.set_height(*options->min_height); |
90 gfx::Size& maximum_size = create_params.maximum_size; | 84 gfx::Size& maximum_size = create_params.maximum_size; |
91 if (options->max_width.get()) | 85 if (options->max_width.get()) |
92 maximum_size.set_width(*options->max_width); | 86 maximum_size.set_width(*options->max_width); |
93 if (options->max_height.get()) | 87 if (options->max_height.get()) |
94 maximum_size.set_height(*options->max_height); | 88 maximum_size.set_height(*options->max_height); |
(...skipping 21 matching lines...) Expand all Loading... |
116 shell_window->GetBaseWindow()->Show(); | 110 shell_window->GetBaseWindow()->Show(); |
117 | 111 |
118 content::WebContents* created_contents = shell_window->web_contents(); | 112 content::WebContents* created_contents = shell_window->web_contents(); |
119 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); | 113 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); |
120 | 114 |
121 SetResult(base::Value::CreateIntegerValue(view_id)); | 115 SetResult(base::Value::CreateIntegerValue(view_id)); |
122 return true; | 116 return true; |
123 } | 117 } |
124 | 118 |
125 } // namespace extensions | 119 } // namespace extensions |
OLD | NEW |