| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 | 1170 |
| 1171 // Re-initialize the UI. | 1171 // Re-initialize the UI. |
| 1172 InitContents(); | 1172 InitContents(); |
| 1173 | 1173 |
| 1174 // Restore previous state. | 1174 // Restore previous state. |
| 1175 service_buttons_->Update(); | 1175 service_buttons_->Update(); |
| 1176 extensions_->Update(); | 1176 extensions_->Update(); |
| 1177 action_label_->SetText(action_text_); | 1177 action_label_->SetText(action_text_); |
| 1178 contents_->Layout(); | 1178 contents_->Layout(); |
| 1179 SizeToContents(); | 1179 SizeToContents(); |
| 1180 | |
| 1181 } | 1180 } |
| 1182 | 1181 |
| 1183 void WebIntentPickerViews::SizeToContents() { | 1182 void WebIntentPickerViews::SizeToContents() { |
| 1184 gfx::Size client_size = contents_->GetPreferredSize(); | 1183 gfx::Size client_size = contents_->GetPreferredSize(); |
| 1185 gfx::Rect client_bounds(client_size); | 1184 gfx::Rect client_bounds(client_size); |
| 1186 gfx::Rect new_window_bounds = window_->non_client_view()->frame_view()-> | 1185 gfx::Rect new_window_bounds = window_->non_client_view()->frame_view()-> |
| 1187 GetWindowBoundsForClientBounds(client_bounds); | 1186 GetWindowBoundsForClientBounds(client_bounds); |
| 1188 window_->CenterWindow(new_window_bounds.size()); | 1187 window_->CenterWindow(new_window_bounds.size()); |
| 1189 } | 1188 } |
| 1190 | 1189 |
| 1191 views::ImageButton* WebIntentPickerViews::CreateCloseButton() { | 1190 views::ImageButton* WebIntentPickerViews::CreateCloseButton() { |
| 1192 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 1191 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 1193 views::ImageButton* close_button = new views::ImageButton(this); | 1192 views::ImageButton* close_button = new views::ImageButton(this); |
| 1194 close_button->SetImage(views::CustomButton::BS_NORMAL, | 1193 close_button->SetImage(views::CustomButton::BS_NORMAL, |
| 1195 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X)); | 1194 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X)); |
| 1196 close_button->SetImage(views::CustomButton::BS_HOT, | 1195 close_button->SetImage(views::CustomButton::BS_HOT, |
| 1197 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); | 1196 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); |
| 1198 close_button->SetImage(views::CustomButton::BS_PUSHED, | 1197 close_button->SetImage(views::CustomButton::BS_PUSHED, |
| 1199 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); | 1198 rb.GetImageSkiaNamed(IDR_SHARED_IMAGES_X_HOVER)); |
| 1200 return close_button; | 1199 return close_button; |
| 1201 } | 1200 } |
| OLD | NEW |