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

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

Issue 10825240: Refactor ShellWindow to separate platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/time.h" 7 #include "base/time.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/shell_window_registry.h" 9 #include "chrome/browser/extensions/shell_window_registry.h"
10 #include "chrome/browser/extensions/window_controller.h" 10 #include "chrome/browser/extensions/window_controller.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 create_params.bounds.set_width(minimum_size.width()); 97 create_params.bounds.set_width(minimum_size.width());
98 98
99 if (maximum_size.height() && 99 if (maximum_size.height() &&
100 create_params.bounds.height() > maximum_size.height()) 100 create_params.bounds.height() > maximum_size.height())
101 create_params.bounds.set_height(maximum_size.height()); 101 create_params.bounds.set_height(maximum_size.height());
102 if (create_params.bounds.height() < minimum_size.height()) 102 if (create_params.bounds.height() < minimum_size.height())
103 create_params.bounds.set_height(minimum_size.height()); 103 create_params.bounds.set_height(minimum_size.height());
104 } 104 }
105 ShellWindow* shell_window = 105 ShellWindow* shell_window =
106 ShellWindow::Create(profile(), GetExtension(), url, create_params); 106 ShellWindow::Create(profile(), GetExtension(), url, create_params);
107 shell_window->Show(); 107 shell_window->GetBaseWindow()->Show();
108 108
109 content::WebContents* created_contents = shell_window->web_contents(); 109 content::WebContents* created_contents = shell_window->web_contents();
110 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); 110 int view_id = created_contents->GetRenderViewHost()->GetRoutingID();
111 111
112 SetResult(base::Value::CreateIntegerValue(view_id)); 112 SetResult(base::Value::CreateIntegerValue(view_id));
113 return true; 113 return true;
114 } 114 }
115 115
116 bool AppWindowFocusFunction::RunWithWindow(ShellWindow* window) { 116 bool AppWindowFocusFunction::RunWithWindow(ShellWindow* window) {
117 window->Activate(); 117 window->GetBaseWindow()->Activate();
118 return true; 118 return true;
119 } 119 }
120 120
121 bool AppWindowMaximizeFunction::RunWithWindow(ShellWindow* window) { 121 bool AppWindowMaximizeFunction::RunWithWindow(ShellWindow* window) {
122 window->Maximize(); 122 window->GetBaseWindow()->Maximize();
123 return true; 123 return true;
124 } 124 }
125 125
126 bool AppWindowMinimizeFunction::RunWithWindow(ShellWindow* window) { 126 bool AppWindowMinimizeFunction::RunWithWindow(ShellWindow* window) {
127 window->Minimize(); 127 window->GetBaseWindow()->Minimize();
128 return true; 128 return true;
129 } 129 }
130 130
131 bool AppWindowRestoreFunction::RunWithWindow(ShellWindow* window) { 131 bool AppWindowRestoreFunction::RunWithWindow(ShellWindow* window) {
132 window->Restore(); 132 window->GetBaseWindow()->Restore();
133 return true; 133 return true;
134 } 134 }
135 135
136 } // namespace extensions 136 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_browsertest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698