Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Side by Side Diff: third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp

Issue 2919593004: Remove dependency of ColorChooserPopupUIController on ChromeClientImpl (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/ColorChooserPopupUIController.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 10 matching lines...) Expand all
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "web/ColorChooserPopupUIController.h" 26 #include "web/ColorChooserPopupUIController.h"
27 27
28 #include "core/frame/LocalFrame.h" 28 #include "core/frame/LocalFrame.h"
29 #include "core/frame/LocalFrameView.h" 29 #include "core/frame/LocalFrameView.h"
30 #include "core/html/forms/ColorChooserClient.h" 30 #include "core/html/forms/ColorChooserClient.h"
31 #include "core/page/ChromeClient.h"
31 #include "core/page/PagePopup.h" 32 #include "core/page/PagePopup.h"
32 #include "platform/geometry/IntRect.h" 33 #include "platform/geometry/IntRect.h"
33 #include "public/platform/Platform.h" 34 #include "public/platform/Platform.h"
34 #include "public/web/WebColorChooser.h" 35 #include "public/web/WebColorChooser.h"
35 #include "web/ChromeClientImpl.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 // Keep in sync with Actions in colorSuggestionPicker.js. 39 // Keep in sync with Actions in colorSuggestionPicker.js.
40 enum ColorPickerPopupAction { 40 enum ColorPickerPopupAction {
41 kColorPickerPopupActionChooseOtherColor = -2, 41 kColorPickerPopupActionChooseOtherColor = -2,
42 kColorPickerPopupActionCancel = -1, 42 kColorPickerPopupActionCancel = -1,
43 kColorPickerPopupActionSetValue = 0 43 kColorPickerPopupActionSetValue = 0
44 }; 44 };
45 45
46 ColorChooserPopupUIController::ColorChooserPopupUIController( 46 ColorChooserPopupUIController::ColorChooserPopupUIController(
47 LocalFrame* frame, 47 LocalFrame* frame,
48 ChromeClientImpl* chrome_client, 48 ChromeClient* chrome_client,
49 ColorChooserClient* client) 49 ColorChooserClient* client)
50 : ColorChooserUIController(frame, client), 50 : ColorChooserUIController(frame, client),
51 chrome_client_(chrome_client), 51 chrome_client_(chrome_client),
52 popup_(nullptr), 52 popup_(nullptr),
53 locale_(Locale::DefaultLocale()) {} 53 locale_(Locale::DefaultLocale()) {}
54 54
55 ColorChooserPopupUIController::~ColorChooserPopupUIController() {} 55 ColorChooserPopupUIController::~ColorChooserPopupUIController() {}
56 56
57 void ColorChooserPopupUIController::Dispose() { 57 void ColorChooserPopupUIController::Dispose() {
58 // Finalized earlier so as to access m_chromeClient while alive. 58 // Finalized earlier so as to access m_chromeClient while alive.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 popup_ = chrome_client_->OpenPagePopup(this); 151 popup_ = chrome_client_->OpenPagePopup(this);
152 } 152 }
153 153
154 void ColorChooserPopupUIController::ClosePopup() { 154 void ColorChooserPopupUIController::ClosePopup() {
155 if (!popup_) 155 if (!popup_)
156 return; 156 return;
157 chrome_client_->ClosePagePopup(popup_); 157 chrome_client_->ClosePagePopup(popup_);
158 } 158 }
159 159
160 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/ColorChooserPopupUIController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698