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/ui/views/extensions/extension_dialog.h" | 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 } | 50 } |
51 | 51 |
52 // static | 52 // static |
53 ExtensionDialog* ExtensionDialog::Show( | 53 ExtensionDialog* ExtensionDialog::Show( |
54 const GURL& url, | 54 const GURL& url, |
55 BaseWindow* base_window, | 55 BaseWindow* base_window, |
56 Profile* profile, | 56 Profile* profile, |
57 WebContents* web_contents, | 57 WebContents* web_contents, |
58 int width, | 58 int width, |
59 int height, | 59 int height, |
60 int minWidth, | |
sky
2013/05/08 16:14:42
min_width, min_height
How do we know we can trust
hirono
2013/05/09 02:23:16
Actually these arguments are added just for callin
sky
2013/05/09 15:51:57
I was assuming these values are coming from script
| |
61 int minHeight, | |
60 const string16& title, | 62 const string16& title, |
61 ExtensionDialogObserver* observer) { | 63 ExtensionDialogObserver* observer) { |
62 extensions::ExtensionHost* host = CreateExtensionHost(url, profile); | 64 extensions::ExtensionHost* host = CreateExtensionHost(url, profile); |
65 // Preferred size must be set before views::Widget::CreateWindowWithParent | |
66 // is called because CreateWindowWithParent refers the result of CanResize(). | |
67 host->view()->SetPreferredSize(gfx::Size(minWidth, minHeight)); | |
63 if (!host) | 68 if (!host) |
64 return NULL; | 69 return NULL; |
65 host->SetAssociatedWebContents(web_contents); | 70 host->SetAssociatedWebContents(web_contents); |
66 | 71 |
67 return ExtensionDialog::ShowInternal(url, base_window, host, width, height, | 72 return ExtensionDialog::ShowInternal(url, base_window, host, width, height, |
68 false, title, observer); | 73 false, title, observer); |
69 } | 74 } |
70 | 75 |
71 #if defined(USE_AURA) | 76 #if defined(USE_AURA) |
72 // static | 77 // static |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 if (content::Details<extensions::ExtensionHost>(host()) != details) | 287 if (content::Details<extensions::ExtensionHost>(host()) != details) |
283 return; | 288 return; |
284 if (observer_) | 289 if (observer_) |
285 observer_->ExtensionTerminated(this); | 290 observer_->ExtensionTerminated(this); |
286 break; | 291 break; |
287 default: | 292 default: |
288 NOTREACHED() << L"Received unexpected notification"; | 293 NOTREACHED() << L"Received unexpected notification"; |
289 break; | 294 break; |
290 } | 295 } |
291 } | 296 } |
OLD | NEW |