| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/page/PagePopup.h" | 33 #include "core/page/PagePopup.h" |
| 34 #include "core/page/PagePopupClient.h" | 34 #include "core/page/PagePopupClient.h" |
| 35 #include "platform/text/PlatformLocale.h" | 35 #include "platform/text/PlatformLocale.h" |
| 36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 PagePopupController::PagePopupController(PagePopup& popup, | 40 PagePopupController::PagePopupController(PagePopup& popup, |
| 41 PagePopupClient* client) | 41 PagePopupClient* client) |
| 42 : popup_(popup), popup_client_(client) { | 42 : popup_(popup), popup_client_(client) { |
| 43 ASSERT(client); | 43 DCHECK(client); |
| 44 } | 44 } |
| 45 | 45 |
| 46 PagePopupController* PagePopupController::Create(PagePopup& popup, | 46 PagePopupController* PagePopupController::Create(PagePopup& popup, |
| 47 PagePopupClient* client) { | 47 PagePopupClient* client) { |
| 48 return new PagePopupController(popup, client); | 48 return new PagePopupController(popup, client); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void PagePopupController::setValueAndClosePopup(int num_value, | 51 void PagePopupController::setValueAndClosePopup(int num_value, |
| 52 const String& string_value) { | 52 const String& string_value) { |
| 53 if (popup_client_) | 53 if (popup_client_) |
| 54 popup_client_->SetValueAndClosePopup(num_value, string_value); | 54 popup_client_->SetValueAndClosePopup(num_value, string_value); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void PagePopupController::setValue(const String& value) { | 57 void PagePopupController::setValue(const String& value) { |
| 58 if (popup_client_) | 58 if (popup_client_) |
| 59 popup_client_->SetValue(value); | 59 popup_client_->SetValue(value); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void PagePopupController::closePopup() { | 62 void PagePopupController::closePopup() { |
| 63 if (popup_client_) | 63 if (popup_client_) |
| 64 popup_client_->ClosePopup(); | 64 popup_client_->ClosePopup(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void PagePopupController::selectFontsFromOwnerDocument( | 67 void PagePopupController::selectFontsFromOwnerDocument( |
| 68 Document* target_document) { | 68 Document* target_document) { |
| 69 ASSERT(target_document); | 69 DCHECK(target_document); |
| 70 if (popup_client_) | 70 if (popup_client_) |
| 71 popup_client_->SelectFontsFromOwnerDocument(*target_document); | 71 popup_client_->SelectFontsFromOwnerDocument(*target_document); |
| 72 } | 72 } |
| 73 | 73 |
| 74 String PagePopupController::localizeNumberString(const String& number_string) { | 74 String PagePopupController::localizeNumberString(const String& number_string) { |
| 75 if (popup_client_) | 75 if (popup_client_) |
| 76 return popup_client_->GetLocale().ConvertToLocalizedNumber(number_string); | 76 return popup_client_->GetLocale().ConvertToLocalizedNumber(number_string); |
| 77 return number_string; | 77 return number_string; |
| 78 } | 78 } |
| 79 | 79 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 void PagePopupController::ClearPagePopupClient() { | 112 void PagePopupController::ClearPagePopupClient() { |
| 113 popup_client_ = nullptr; | 113 popup_client_ = nullptr; |
| 114 } | 114 } |
| 115 | 115 |
| 116 void PagePopupController::setWindowRect(int x, int y, int width, int height) { | 116 void PagePopupController::setWindowRect(int x, int y, int width, int height) { |
| 117 popup_.SetWindowRect(IntRect(x, y, width, height)); | 117 popup_.SetWindowRect(IntRect(x, y, width, height)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |