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

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

Issue 10910304: Cache the object given to the chrome.app.window.create callback (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: improve cohesion with the prototype / JS context based on verbal feedback Created 8 years, 3 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
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/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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (create_params.bounds.height() < minimum_size.height()) 105 if (create_params.bounds.height() < minimum_size.height())
106 create_params.bounds.set_height(minimum_size.height()); 106 create_params.bounds.set_height(minimum_size.height());
107 } 107 }
108 ShellWindow* shell_window = 108 ShellWindow* shell_window =
109 ShellWindow::Create(profile(), GetExtension(), url, create_params); 109 ShellWindow::Create(profile(), GetExtension(), url, create_params);
110 shell_window->GetBaseWindow()->Show(); 110 shell_window->GetBaseWindow()->Show();
111 111
112 content::WebContents* created_contents = shell_window->web_contents(); 112 content::WebContents* created_contents = shell_window->web_contents();
113 int view_id = created_contents->GetRenderViewHost()->GetRoutingID(); 113 int view_id = created_contents->GetRenderViewHost()->GetRoutingID();
114 114
115 SetResult(base::Value::CreateIntegerValue(view_id)); 115 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue);
116 result->SetInteger("viewId", view_id);
117 result->SetString("id", shell_window->window_key());
118
119 SetResult(result.release());
116 return true; 120 return true;
117 } 121 }
118 122
119 } // namespace extensions 123 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698