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

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

Issue 2887523003: Introduced WebFactory and WebFactoryImpl for constructing web/ classes (Closed)
Patch Set: Removed file from wrong branch Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "web/WebViewImpl.h" 31 #include "web/WebViewImpl.h"
32 32
33 #include <memory> 33 #include <memory>
34 #include "core/CSSValueKeywords.h" 34 #include "core/CSSValueKeywords.h"
35 #include "core/HTMLNames.h" 35 #include "core/HTMLNames.h"
36 #include "core/WebFactory.h"
36 #include "core/clipboard/DataObject.h" 37 #include "core/clipboard/DataObject.h"
37 #include "core/dom/ContextFeaturesClientImpl.h" 38 #include "core/dom/ContextFeaturesClientImpl.h"
38 #include "core/dom/Document.h" 39 #include "core/dom/Document.h"
39 #include "core/dom/DocumentUserGestureToken.h" 40 #include "core/dom/DocumentUserGestureToken.h"
40 #include "core/dom/Fullscreen.h" 41 #include "core/dom/Fullscreen.h"
41 #include "core/dom/LayoutTreeBuilderTraversal.h" 42 #include "core/dom/LayoutTreeBuilderTraversal.h"
42 #include "core/dom/Text.h" 43 #include "core/dom/Text.h"
43 #include "core/editing/EditingUtilities.h" 44 #include "core/editing/EditingUtilities.h"
44 #include "core/editing/Editor.h" 45 #include "core/editing/Editor.h"
45 #include "core/editing/FrameSelection.h" 46 #include "core/editing/FrameSelection.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // static 332 // static
332 HashSet<WebViewBase*>& WebViewBase::AllInstances() { 333 HashSet<WebViewBase*>& WebViewBase::AllInstances() {
333 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ()); 334 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ());
334 return all_instances; 335 return all_instances;
335 } 336 }
336 337
337 WebViewImpl::WebViewImpl(WebViewClient* client, 338 WebViewImpl::WebViewImpl(WebViewClient* client,
338 WebPageVisibilityState visibility_state) 339 WebPageVisibilityState visibility_state)
339 : client_(client), 340 : client_(client),
340 spell_check_client_(nullptr), 341 spell_check_client_(nullptr),
341 chrome_client_impl_(ChromeClientImpl::Create(this)), 342 chrome_client_(WebFactory::GetInstance().CreateChromeClient(this)),
haraken 2017/05/23 01:56:35 Just to clarify: How will this code be in the end
sashab 2017/05/29 04:34:01 Yes to both. :)
342 context_menu_client_impl_(this), 343 context_menu_client_impl_(this),
343 editor_client_impl_(this), 344 editor_client_impl_(this),
344 spell_checker_client_impl_(this), 345 spell_checker_client_impl_(this),
345 storage_client_impl_(this), 346 storage_client_impl_(this),
346 should_auto_resize_(false), 347 should_auto_resize_(false),
347 zoom_level_(0), 348 zoom_level_(0),
348 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), 349 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)),
349 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)), 350 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)),
350 zoom_factor_for_device_scale_factor_(0.f), 351 zoom_factor_for_device_scale_factor_(0.f),
351 maximum_legible_scale_(1), 352 maximum_legible_scale_(1),
(...skipping 28 matching lines...) Expand all
380 elastic_overscroll_(FloatSize()), 381 elastic_overscroll_(FloatSize()),
381 mutator_(nullptr), 382 mutator_(nullptr),
382 scheduler_(WTF::WrapUnique(Platform::Current() 383 scheduler_(WTF::WrapUnique(Platform::Current()
383 ->CurrentThread() 384 ->CurrentThread()
384 ->Scheduler() 385 ->Scheduler()
385 ->CreateWebViewScheduler(this, this) 386 ->CreateWebViewScheduler(this, this)
386 .release())), 387 .release())),
387 last_frame_time_monotonic_(0), 388 last_frame_time_monotonic_(0),
388 override_compositor_visibility_(false) { 389 override_compositor_visibility_(false) {
389 Page::PageClients page_clients; 390 Page::PageClients page_clients;
390 page_clients.chrome_client = chrome_client_impl_.Get(); 391 page_clients.chrome_client = chrome_client_.Get();
391 page_clients.context_menu_client = &context_menu_client_impl_; 392 page_clients.context_menu_client = &context_menu_client_impl_;
392 page_clients.editor_client = &editor_client_impl_; 393 page_clients.editor_client = &editor_client_impl_;
393 page_clients.spell_checker_client = &spell_checker_client_impl_; 394 page_clients.spell_checker_client = &spell_checker_client_impl_;
394 395
395 page_ = Page::CreateOrdinary(page_clients); 396 page_ = Page::CreateOrdinary(page_clients);
396 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_); 397 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_);
397 ProvideSpeechRecognitionTo( 398 ProvideSpeechRecognitionTo(
398 *page_, SpeechRecognitionClientProxy::Create( 399 *page_, SpeechRecognitionClientProxy::Create(
399 client ? client->SpeechRecognizer() : nullptr)); 400 client ? client->SpeechRecognizer() : nullptr));
400 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create()); 401 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create());
(...skipping 3761 matching lines...) Expand 10 before | Expand all | Expand 10 after
4162 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4163 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4163 return nullptr; 4164 return nullptr;
4164 return focused_frame; 4165 return focused_frame;
4165 } 4166 }
4166 4167
4167 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4168 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4168 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4169 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4169 } 4170 }
4170 4171
4171 } // namespace blink 4172 } // namespace blink
OLDNEW
« third_party/WebKit/Source/web/WebViewImpl.h ('K') | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698