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/chromeos/login/ui/simple_web_view_dialog.h" | 5 #include "chrome/browser/chromeos/login/ui/simple_web_view_dialog.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
12 #include "chrome/browser/chromeos/login/helper.h" | 12 #include "chrome/browser/chromeos/login/helper.h" |
13 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" | 13 #include "chrome/browser/chromeos/login/ui/captive_portal_window_proxy.h" |
14 #include "chrome/browser/command_updater.h" | 14 #include "chrome/browser/command_updater.h" |
15 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 15 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ssl/security_state_model.h" | 17 #include "chrome/browser/ssl/chrome_security_state_model_delegate.h" |
18 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 18 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" | 20 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" |
21 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 21 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
22 #include "chrome/browser/ui/view_ids.h" | 22 #include "chrome/browser/ui/view_ids.h" |
23 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 23 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
24 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
25 #include "chrome/grit/theme_resources.h" | 25 #include "chrome/grit/theme_resources.h" |
26 #include "components/password_manager/core/browser/password_manager.h" | 26 #include "components/password_manager/core/browser/password_manager.h" |
27 #include "content/public/browser/navigation_controller.h" | 27 #include "content/public/browser/navigation_controller.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Create the password manager that is needed for the proxy. | 156 // Create the password manager that is needed for the proxy. |
157 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( | 157 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( |
158 web_contents, | 158 web_contents, |
159 autofill::ChromeAutofillClient::FromWebContents(web_contents)); | 159 autofill::ChromeAutofillClient::FromWebContents(web_contents)); |
160 } | 160 } |
161 | 161 |
162 void SimpleWebViewDialog::Init() { | 162 void SimpleWebViewDialog::Init() { |
163 // Create the security state model that the toolbar model needs. | 163 // Create the security state model that the toolbar model needs. |
164 if (web_view_->GetWebContents()) | 164 if (web_view_->GetWebContents()) |
165 SecurityStateModel::CreateForWebContents(web_view_->GetWebContents()); | 165 ChromeSecurityStateModelDelegate::CreateForWebContents( |
| 166 web_view_->GetWebContents()); |
166 toolbar_model_.reset(new ToolbarModelImpl(this)); | 167 toolbar_model_.reset(new ToolbarModelImpl(this)); |
167 | 168 |
168 set_background(views::Background::CreateSolidBackground(kDialogColor)); | 169 set_background(views::Background::CreateSolidBackground(kDialogColor)); |
169 | 170 |
170 // Back/Forward buttons. | 171 // Back/Forward buttons. |
171 back_ = new views::ImageButton(this); | 172 back_ = new views::ImageButton(this); |
172 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | | 173 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | |
173 ui::EF_MIDDLE_MOUSE_BUTTON); | 174 ui::EF_MIDDLE_MOUSE_BUTTON); |
174 back_->set_tag(IDC_BACK); | 175 back_->set_tag(IDC_BACK); |
175 back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT, | 176 back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 298 } |
298 | 299 |
299 ContentSettingBubbleModelDelegate* | 300 ContentSettingBubbleModelDelegate* |
300 SimpleWebViewDialog::GetContentSettingBubbleModelDelegate() { | 301 SimpleWebViewDialog::GetContentSettingBubbleModelDelegate() { |
301 return bubble_model_delegate_.get(); | 302 return bubble_model_delegate_.get(); |
302 } | 303 } |
303 | 304 |
304 void SimpleWebViewDialog::ShowWebsiteSettings( | 305 void SimpleWebViewDialog::ShowWebsiteSettings( |
305 content::WebContents* web_contents, | 306 content::WebContents* web_contents, |
306 const GURL& url, | 307 const GURL& url, |
307 const SecurityStateModel::SecurityInfo& security_info) { | 308 const security_state::SecurityInfo& security_info) { |
308 NOTIMPLEMENTED(); | 309 NOTIMPLEMENTED(); |
309 // TODO (markusheintz@): implement this | 310 // TODO (markusheintz@): implement this |
310 } | 311 } |
311 | 312 |
312 PageActionImageView* SimpleWebViewDialog::CreatePageActionImageView( | 313 PageActionImageView* SimpleWebViewDialog::CreatePageActionImageView( |
313 LocationBarView* owner, | 314 LocationBarView* owner, |
314 ExtensionAction* action) { | 315 ExtensionAction* action) { |
315 // Notreached because SimpleWebViewDialog uses a popup-mode LocationBarView, | 316 // Notreached because SimpleWebViewDialog uses a popup-mode LocationBarView, |
316 // and it doesn't create PageActionImageViews. | 317 // and it doesn't create PageActionImageViews. |
317 NOTREACHED(); | 318 NOTREACHED(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 388 |
388 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 389 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
389 if (reload_) { | 390 if (reload_) { |
390 reload_->ChangeMode( | 391 reload_->ChangeMode( |
391 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 392 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
392 force); | 393 force); |
393 } | 394 } |
394 } | 395 } |
395 | 396 |
396 } // namespace chromeos | 397 } // namespace chromeos |
OLD | NEW |