| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
| 36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 37 #include "grit/locale_settings.h" | 37 #include "grit/locale_settings.h" |
| 38 #include "grit/theme_resources.h" | 38 #include "grit/theme_resources.h" |
| 39 #include "ui/base/l10n/l10n_util.h" | 39 #include "ui/base/l10n/l10n_util.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 40 #include "ui/base/resource/resource_bundle.h" |
| 41 #include "views/controls/button/checkbox.h" | 41 #include "views/controls/button/checkbox.h" |
| 42 #include "views/controls/button/native_button_gtk.h" | 42 #include "views/controls/button/native_button_gtk.h" |
| 43 #include "views/controls/label.h" | 43 #include "views/controls/label.h" |
| 44 #include "views/controls/throbber.h" | 44 #include "views/controls/throbber.h" |
| 45 #include "views/events/event.h" |
| 45 #include "views/layout/grid_layout.h" | 46 #include "views/layout/grid_layout.h" |
| 46 #include "views/layout/layout_constants.h" | 47 #include "views/layout/layout_constants.h" |
| 47 #include "views/layout/layout_manager.h" | 48 #include "views/layout/layout_manager.h" |
| 48 #include "views/widget/widget_gtk.h" | 49 #include "views/widget/widget_gtk.h" |
| 49 #include "views/window/dialog_delegate.h" | 50 #include "views/window/dialog_delegate.h" |
| 50 #include "views/window/window.h" | 51 #include "views/window/window.h" |
| 51 | 52 |
| 52 using views::WidgetGtk; | 53 using views::WidgetGtk; |
| 53 | 54 |
| 54 namespace { | 55 namespace { |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 if (changed_flags & TabContents::INVALIDATE_TITLE) { | 527 if (changed_flags & TabContents::INVALIDATE_TITLE) { |
| 527 if (PublishTitleIfReady(contents, google_eula_view_, google_eula_label_) || | 528 if (PublishTitleIfReady(contents, google_eula_view_, google_eula_label_) || |
| 528 PublishTitleIfReady(contents, oem_eula_view_, oem_eula_label_)) { | 529 PublishTitleIfReady(contents, oem_eula_view_, oem_eula_label_)) { |
| 529 Layout(); | 530 Layout(); |
| 530 } | 531 } |
| 531 } | 532 } |
| 532 } | 533 } |
| 533 | 534 |
| 534 void EulaView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 535 void EulaView::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 535 views::Widget* widget = GetWidget(); | 536 views::Widget* widget = GetWidget(); |
| 536 if (widget && event.os_event && !event.skip_in_browser) | 537 if (widget && event.os_event && !event.skip_in_browser) { |
| 537 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(event.os_event); | 538 views::KeyEvent views_event(reinterpret_cast<GdkEvent*>(event.os_event)); |
| 539 static_cast<views::WidgetGtk*>(widget)->HandleKeyboardEvent(views_event); |
| 540 } |
| 538 } | 541 } |
| 539 | 542 |
| 540 //////////////////////////////////////////////////////////////////////////////// | 543 //////////////////////////////////////////////////////////////////////////////// |
| 541 // EulaView, private: | 544 // EulaView, private: |
| 542 | 545 |
| 543 void EulaView::LoadEulaView(DOMView* eula_view, | 546 void EulaView::LoadEulaView(DOMView* eula_view, |
| 544 views::Label* eula_label, | 547 views::Label* eula_label, |
| 545 const GURL& eula_url) { | 548 const GURL& eula_url) { |
| 546 Profile* profile = ProfileManager::GetDefaultProfile(); | 549 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 547 eula_view->Init(profile, | 550 eula_view->Init(profile, |
| 548 SiteInstance::CreateSiteInstanceForURL(profile, eula_url)); | 551 SiteInstance::CreateSiteInstanceForURL(profile, eula_url)); |
| 549 eula_view->LoadURL(eula_url); | 552 eula_view->LoadURL(eula_url); |
| 550 eula_view->tab_contents()->set_delegate(this); | 553 eula_view->tab_contents()->set_delegate(this); |
| 551 } | 554 } |
| 552 | 555 |
| 553 //////////////////////////////////////////////////////////////////////////////// | 556 //////////////////////////////////////////////////////////////////////////////// |
| 554 // EulaView, private, views::View implementation: | 557 // EulaView, private, views::View implementation: |
| 555 | 558 |
| 556 bool EulaView::OnKeyPressed(const views::KeyEvent&) { | 559 bool EulaView::OnKeyPressed(const views::KeyEvent&) { |
| 557 // Close message bubble if shown. bubble_ will be set to NULL in callback. | 560 // Close message bubble if shown. bubble_ will be set to NULL in callback. |
| 558 if (bubble_) { | 561 if (bubble_) { |
| 559 bubble_->Close(); | 562 bubble_->Close(); |
| 560 return true; | 563 return true; |
| 561 } | 564 } |
| 562 return false; | 565 return false; |
| 563 } | 566 } |
| 564 | 567 |
| 565 } // namespace chromeos | 568 } // namespace chromeos |
| OLD | NEW |