OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/eula_view.h" | 5 #include "chrome/browser/chromeos/login/eula_view.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
12 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
18 #include "chrome/browser/chromeos/cros_settings_provider_stats.h" | 18 #include "chrome/browser/chromeos/cros_settings_provider_stats.h" |
19 #include "chrome/browser/chromeos/customization_document.h" | 19 #include "chrome/browser/chromeos/customization_document.h" |
20 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 20 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
21 #include "chrome/browser/chromeos/login/network_screen_delegate.h" | 21 #include "chrome/browser/chromeos/login/network_screen_delegate.h" |
22 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 22 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
23 #include "chrome/browser/chromeos/login/wizard_controller.h" | 23 #include "chrome/browser/chromeos/login/wizard_controller.h" |
24 #include "chrome/browser/profile_manager.h" | 24 #include "chrome/browser/profile_manager.h" |
25 #include "chrome/browser/renderer_host/site_instance.h" | 25 #include "chrome/browser/renderer_host/site_instance.h" |
26 #include "chrome/browser/tab_contents/tab_contents.h" | 26 #include "chrome/browser/tab_contents/tab_contents.h" |
27 #include "chrome/browser/views/dom_view.h" | 27 #include "chrome/browser/views/dom_view.h" |
| 28 #include "chrome/browser/views/window.h" |
28 #include "chrome/common/native_web_keyboard_event.h" | 29 #include "chrome/common/native_web_keyboard_event.h" |
29 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
30 #include "cros/chromeos_cryptohome.h" | 31 #include "cros/chromeos_cryptohome.h" |
31 #include "grit/chromium_strings.h" | 32 #include "grit/chromium_strings.h" |
32 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
33 #include "grit/locale_settings.h" | 34 #include "grit/locale_settings.h" |
34 #include "grit/theme_resources.h" | 35 #include "grit/theme_resources.h" |
35 #include "views/controls/button/checkbox.h" | 36 #include "views/controls/button/checkbox.h" |
36 #include "views/controls/button/native_button.h" | 37 #include "views/controls/button/native_button.h" |
37 #include "views/controls/label.h" | 38 #include "views/controls/label.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // Pull the password from TPM. | 366 // Pull the password from TPM. |
366 std::string password; | 367 std::string password; |
367 if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) { | 368 if (!chromeos::CrosLibrary::Get()->EnsureLoaded()) { |
368 LOG(ERROR) << "Cros library not loaded. " | 369 LOG(ERROR) << "Cros library not loaded. " |
369 << "We must have disabled the link that led here."; | 370 << "We must have disabled the link that led here."; |
370 return; | 371 return; |
371 } else if (chromeos::CryptohomeTpmIsReady() && | 372 } else if (chromeos::CryptohomeTpmIsReady() && |
372 chromeos::CryptohomeTpmGetPassword(&password)) { | 373 chromeos::CryptohomeTpmGetPassword(&password)) { |
373 TpmInfoView* view = new TpmInfoView(ASCIIToWide(password)); | 374 TpmInfoView* view = new TpmInfoView(ASCIIToWide(password)); |
374 view->Init(); | 375 view->Init(); |
375 views::Window* window = views::Window::CreateChromeWindow( | 376 views::Window* window = browser::CreateViewsWindow( |
376 GetNativeWindow(), gfx::Rect(), view); | 377 GetNativeWindow(), gfx::Rect(), view); |
377 window->SetIsAlwaysOnTop(true); | 378 window->SetIsAlwaysOnTop(true); |
378 window->Show(); | 379 window->Show(); |
379 } else { | 380 } else { |
380 if (!bubble_) | 381 if (!bubble_) |
381 bubble_ = MessageBubble::Show( | 382 bubble_ = MessageBubble::Show( |
382 system_security_settings_link_->GetWidget(), | 383 system_security_settings_link_->GetWidget(), |
383 system_security_settings_link_->GetScreenBounds(), | 384 system_security_settings_link_->GetScreenBounds(), |
384 BubbleBorder::LEFT_TOP, | 385 BubbleBorder::LEFT_TOP, |
385 ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING), | 386 ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING), |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 bool EulaView::OnKeyPressed(const views::KeyEvent&) { | 444 bool EulaView::OnKeyPressed(const views::KeyEvent&) { |
444 // Close message bubble if shown. bubble_ will be set to NULL in callback. | 445 // Close message bubble if shown. bubble_ will be set to NULL in callback. |
445 if (bubble_) { | 446 if (bubble_) { |
446 bubble_->Close(); | 447 bubble_->Close(); |
447 return true; | 448 return true; |
448 } | 449 } |
449 return false; | 450 return false; |
450 } | 451 } |
451 | 452 |
452 } // namespace chromeos | 453 } // namespace chromeos |
OLD | NEW |