OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/guest_view/extension_options/extension_options_guest.h" | 5 #include "chrome/browser/guest_view/extension_options/extension_options_guest.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 8 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
9 #include "chrome/browser/guest_view/extension_options/extension_options_constant
s.h" | 9 #include "chrome/browser/guest_view/extension_options/extension_options_constant
s.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 extension_options_internal::OnSizeChanged::kEventName, args.Pass())); | 151 extension_options_internal::OnSizeChanged::kEventName, args.Pass())); |
152 } | 152 } |
153 | 153 |
154 bool ExtensionOptionsGuest::IsAutoSizeSupported() const { | 154 bool ExtensionOptionsGuest::IsAutoSizeSupported() const { |
155 return true; | 155 return true; |
156 } | 156 } |
157 | 157 |
158 void ExtensionOptionsGuest::SetUpAutoSize() { | 158 void ExtensionOptionsGuest::SetUpAutoSize() { |
159 // Read the autosize parameters passed in from the embedder. | 159 // Read the autosize parameters passed in from the embedder. |
160 bool auto_size_enabled = false; | 160 bool auto_size_enabled = false; |
161 extra_params()->GetBoolean(extensionoptions::kAttributeAutoSize, | 161 attach_params()->GetBoolean(extensionoptions::kAttributeAutoSize, |
162 &auto_size_enabled); | 162 &auto_size_enabled); |
163 | 163 |
164 int max_height = 0; | 164 int max_height = 0; |
165 int max_width = 0; | 165 int max_width = 0; |
166 extra_params()->GetInteger(extensionoptions::kAttributeMaxHeight, | 166 attach_params()->GetInteger(extensionoptions::kAttributeMaxHeight, |
167 &max_height); | 167 &max_height); |
168 extra_params()->GetInteger(extensionoptions::kAttributeMaxWidth, &max_width); | 168 attach_params()->GetInteger(extensionoptions::kAttributeMaxWidth, &max_width); |
169 | 169 |
170 int min_height = 0; | 170 int min_height = 0; |
171 int min_width = 0; | 171 int min_width = 0; |
172 extra_params()->GetInteger(extensionoptions::kAttributeMinHeight, | 172 attach_params()->GetInteger(extensionoptions::kAttributeMinHeight, |
173 &min_height); | 173 &min_height); |
174 extra_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); | 174 attach_params()->GetInteger(extensionoptions::kAttributeMinWidth, &min_width); |
175 | 175 |
176 // Call SetAutoSize to apply all the appropriate validation and clipping of | 176 // Call SetAutoSize to apply all the appropriate validation and clipping of |
177 // values. | 177 // values. |
178 SetAutoSize( | 178 SetAutoSize( |
179 true, gfx::Size(min_width, min_height), gfx::Size(max_width, max_height)); | 179 true, gfx::Size(min_width, min_height), gfx::Size(max_width, max_height)); |
180 } | 180 } |
OLD | NEW |