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/extension_window_controller.h" | 9 #include "chrome/browser/extensions/extension_window_controller.h" |
10 #include "chrome/browser/extensions/extension_window_list.h" | 10 #include "chrome/browser/extensions/extension_window_list.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (create_params.bounds.height() < minimum_size.height()) | 103 if (create_params.bounds.height() < minimum_size.height()) |
104 create_params.bounds.set_height(minimum_size.height()); | 104 create_params.bounds.set_height(minimum_size.height()); |
105 } | 105 } |
106 ShellWindow* shell_window = | 106 ShellWindow* shell_window = |
107 ShellWindow::Create(profile(), GetExtension(), url, create_params); | 107 ShellWindow::Create(profile(), GetExtension(), url, create_params); |
108 shell_window->Show(); | 108 shell_window->Show(); |
109 | 109 |
110 content::WebContents* created_contents = shell_window->web_contents(); | 110 content::WebContents* created_contents = shell_window->web_contents(); |
111 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); | 111 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); |
112 | 112 |
113 result_.reset(base::Value::CreateIntegerValue(view_id)); | 113 SetResult(base::Value::CreateIntegerValue(view_id)); |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 bool AppWindowFocusFunction::RunWithWindow(ShellWindow* window) { | 117 bool AppWindowFocusFunction::RunWithWindow(ShellWindow* window) { |
118 window->Activate(); | 118 window->Activate(); |
119 return true; | 119 return true; |
120 } | 120 } |
121 | 121 |
122 bool AppWindowMaximizeFunction::RunWithWindow(ShellWindow* window) { | 122 bool AppWindowMaximizeFunction::RunWithWindow(ShellWindow* window) { |
123 window->Maximize(); | 123 window->Maximize(); |
124 return true; | 124 return true; |
125 } | 125 } |
126 | 126 |
127 bool AppWindowMinimizeFunction::RunWithWindow(ShellWindow* window) { | 127 bool AppWindowMinimizeFunction::RunWithWindow(ShellWindow* window) { |
128 window->Minimize(); | 128 window->Minimize(); |
129 return true; | 129 return true; |
130 } | 130 } |
131 | 131 |
132 bool AppWindowRestoreFunction::RunWithWindow(ShellWindow* window) { | 132 bool AppWindowRestoreFunction::RunWithWindow(ShellWindow* window) { |
133 window->Restore(); | 133 window->Restore(); |
134 return true; | 134 return true; |
135 } | 135 } |
136 | 136 |
137 } // namespace extensions | 137 } // namespace extensions |
OLD | NEW |