| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" | 22 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" |
| 23 #include "chrome/browser/ui/view_ids.h" | 23 #include "chrome/browser/ui/view_ids.h" |
| 24 #include "chrome/browser/ui/views/toolbar/reload_button.h" | 24 #include "chrome/browser/ui/views/toolbar/reload_button.h" |
| 25 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| 26 #include "chrome/grit/theme_resources.h" | 26 #include "chrome/grit/theme_resources.h" |
| 27 #include "components/password_manager/core/browser/password_manager.h" | 27 #include "components/password_manager/core/browser/password_manager.h" |
| 28 #include "components/security_state/security_state_model.h" | 28 #include "components/security_state/security_state_model.h" |
| 29 #include "content/public/browser/navigation_controller.h" | 29 #include "content/public/browser/navigation_controller.h" |
| 30 #include "content/public/browser/navigation_entry.h" | 30 #include "content/public/browser/navigation_entry.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/content_constants.h" |
| 32 #include "grit/components_strings.h" | 33 #include "grit/components_strings.h" |
| 33 #include "ipc/ipc_message.h" | 34 #include "ipc/ipc_message.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/theme_provider.h" | 36 #include "ui/base/theme_provider.h" |
| 36 #include "ui/views/background.h" | 37 #include "ui/views/background.h" |
| 37 #include "ui/views/controls/webview/webview.h" | 38 #include "ui/views/controls/webview/webview.h" |
| 38 #include "ui/views/layout/grid_layout.h" | 39 #include "ui/views/layout/grid_layout.h" |
| 39 #include "ui/views/layout/layout_constants.h" | 40 #include "ui/views/layout/layout_constants.h" |
| 40 #include "ui/views/view.h" | 41 #include "ui/views/view.h" |
| 41 #include "ui/views/widget/widget.h" | 42 #include "ui/views/widget/widget.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( | 160 ChromePasswordManagerClient::CreateForWebContentsWithAutofillClient( |
| 160 web_contents, | 161 web_contents, |
| 161 autofill::ChromeAutofillClient::FromWebContents(web_contents)); | 162 autofill::ChromeAutofillClient::FromWebContents(web_contents)); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void SimpleWebViewDialog::Init() { | 165 void SimpleWebViewDialog::Init() { |
| 165 // Create the security state model that the toolbar model needs. | 166 // Create the security state model that the toolbar model needs. |
| 166 if (web_view_->GetWebContents()) | 167 if (web_view_->GetWebContents()) |
| 167 ChromeSecurityStateModelClient::CreateForWebContents( | 168 ChromeSecurityStateModelClient::CreateForWebContents( |
| 168 web_view_->GetWebContents()); | 169 web_view_->GetWebContents()); |
| 169 toolbar_model_.reset(new ToolbarModelImpl(this)); | 170 toolbar_model_.reset( |
| 171 new ToolbarModelImpl(this, content::kMaxURLDisplayChars)); |
| 170 | 172 |
| 171 set_background(views::Background::CreateSolidBackground(kDialogColor)); | 173 set_background(views::Background::CreateSolidBackground(kDialogColor)); |
| 172 | 174 |
| 173 // Back/Forward buttons. | 175 // Back/Forward buttons. |
| 174 back_ = new views::ImageButton(this); | 176 back_ = new views::ImageButton(this); |
| 175 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | | 177 back_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | |
| 176 ui::EF_MIDDLE_MOUSE_BUTTON); | 178 ui::EF_MIDDLE_MOUSE_BUTTON); |
| 177 back_->set_tag(IDC_BACK); | 179 back_->set_tag(IDC_BACK); |
| 178 back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT, | 180 back_->SetImageAlignment(views::ImageButton::ALIGN_RIGHT, |
| 179 views::ImageButton::ALIGN_TOP); | 181 views::ImageButton::ALIGN_TOP); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 392 |
| 391 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { | 393 void SimpleWebViewDialog::UpdateReload(bool is_loading, bool force) { |
| 392 if (reload_) { | 394 if (reload_) { |
| 393 reload_->ChangeMode( | 395 reload_->ChangeMode( |
| 394 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, | 396 is_loading ? ReloadButton::MODE_STOP : ReloadButton::MODE_RELOAD, |
| 395 force); | 397 force); |
| 396 } | 398 } |
| 397 } | 399 } |
| 398 | 400 |
| 399 } // namespace chromeos | 401 } // namespace chromeos |
| OLD | NEW |