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/chromeos/login/simple_web_view_dialog.h" | 5 #include "chrome/browser/chromeos/login/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.h" | 9 #include "base/message_loop.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/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/captive_portal_window_proxy.h" | 12 #include "chrome/browser/chromeos/login/captive_portal_window_proxy.h" |
13 #include "chrome/browser/command_updater.h" | 13 #include "chrome/browser/command_updater.h" |
14 #include "chrome/browser/password_manager/password_manager.h" | 14 #include "chrome/browser/password_manager/password_manager.h" |
15 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 15 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/constrained_window_tab_helper.h" | |
19 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" | 18 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega
te.h" |
20 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 19 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
21 #include "chrome/browser/ui/view_ids.h" | 20 #include "chrome/browser/ui/view_ids.h" |
22 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" | 21 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
23 #include "chrome/browser/ui/views/page_info_bubble_view.h" | 22 #include "chrome/browser/ui/views/page_info_bubble_view.h" |
24 #include "chrome/browser/ui/views/reload_button.h" | 23 #include "chrome/browser/ui/views/reload_button.h" |
| 24 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
25 #include "content/public/browser/navigation_controller.h" | 25 #include "content/public/browser/navigation_controller.h" |
26 #include "content/public/browser/navigation_entry.h" | 26 #include "content/public/browser/navigation_entry.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
29 #include "grit/theme_resources.h" | 29 #include "grit/theme_resources.h" |
30 #include "ipc/ipc_message.h" | 30 #include "ipc/ipc_message.h" |
31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
32 #include "ui/base/theme_provider.h" | 32 #include "ui/base/theme_provider.h" |
33 #include "ui/views/background.h" | 33 #include "ui/views/background.h" |
34 #include "ui/views/controls/webview/webview.h" | 34 #include "ui/views/controls/webview/webview.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 WebContents* web_contents = web_view_->GetWebContents(); | 152 WebContents* web_contents = web_view_->GetWebContents(); |
153 DCHECK(web_contents); | 153 DCHECK(web_contents); |
154 | 154 |
155 // Create the password manager that is needed for the proxy. | 155 // Create the password manager that is needed for the proxy. |
156 PasswordManagerDelegateImpl::CreateForWebContents(web_contents); | 156 PasswordManagerDelegateImpl::CreateForWebContents(web_contents); |
157 PasswordManager::CreateForWebContentsAndDelegate( | 157 PasswordManager::CreateForWebContentsAndDelegate( |
158 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents)); | 158 web_contents, PasswordManagerDelegateImpl::FromWebContents(web_contents)); |
159 | 159 |
160 // LoginHandlerViews uses a constrained window for the password manager view. | 160 // LoginHandlerViews uses a constrained window for the password manager view. |
161 ConstrainedWindowTabHelper::CreateForWebContents(web_contents); | 161 WebContentsModalDialogManager::CreateForWebContents(web_contents); |
162 } | 162 } |
163 | 163 |
164 void SimpleWebViewDialog::Init() { | 164 void SimpleWebViewDialog::Init() { |
165 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); | 165 set_background(views::Background::CreateSolidBackground(SK_ColorWHITE)); |
166 | 166 |
167 // Back/Forward buttons. | 167 // Back/Forward buttons. |
168 back_ = new views::ImageButton(this); | 168 back_ = new views::ImageButton(this); |
169 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | | 169 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | |
170 ui::EF_MIDDLE_MOUSE_BUTTON); | 170 ui::EF_MIDDLE_MOUSE_BUTTON); |
171 back_->set_tag(IDC_BACK); | 171 back_->set_tag(IDC_BACK); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 391 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
392 if (reload_) { | 392 if (reload_) { |
393 reload_->ChangeMode( | 393 reload_->ChangeMode( |
394 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 394 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
395 force); | 395 force); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
399 } // namespace chromeos | 399 } // namespace chromeos |
OLD | NEW |