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

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

Issue 2887523003: Introduced WebFactory and WebFactoryImpl for constructing web/ classes (Closed)
Patch Set: Added TODOs for review feedback 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/WebViewImpl.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) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/editing/Editor.h" 44 #include "core/editing/Editor.h"
45 #include "core/editing/FrameSelection.h" 45 #include "core/editing/FrameSelection.h"
46 #include "core/editing/InputMethodController.h" 46 #include "core/editing/InputMethodController.h"
47 #include "core/editing/iterators/TextIterator.h" 47 #include "core/editing/iterators/TextIterator.h"
48 #include "core/editing/serializers/HTMLInterchange.h" 48 #include "core/editing/serializers/HTMLInterchange.h"
49 #include "core/editing/serializers/Serialization.h" 49 #include "core/editing/serializers/Serialization.h"
50 #include "core/events/KeyboardEvent.h" 50 #include "core/events/KeyboardEvent.h"
51 #include "core/events/UIEventWithKeyState.h" 51 #include "core/events/UIEventWithKeyState.h"
52 #include "core/events/WebInputEventConversion.h" 52 #include "core/events/WebInputEventConversion.h"
53 #include "core/events/WheelEvent.h" 53 #include "core/events/WheelEvent.h"
54 #include "core/exported/WebFactory.h"
54 #include "core/exported/WebPluginContainerBase.h" 55 #include "core/exported/WebPluginContainerBase.h"
55 #include "core/frame/BrowserControls.h" 56 #include "core/frame/BrowserControls.h"
56 #include "core/frame/EventHandlerRegistry.h" 57 #include "core/frame/EventHandlerRegistry.h"
57 #include "core/frame/LocalFrame.h" 58 #include "core/frame/LocalFrame.h"
58 #include "core/frame/LocalFrameClient.h" 59 #include "core/frame/LocalFrameClient.h"
59 #include "core/frame/LocalFrameView.h" 60 #include "core/frame/LocalFrameView.h"
60 #include "core/frame/PageScaleConstraintsSet.h" 61 #include "core/frame/PageScaleConstraintsSet.h"
61 #include "core/frame/RemoteFrame.h" 62 #include "core/frame/RemoteFrame.h"
62 #include "core/frame/ResizeViewportAnchor.h" 63 #include "core/frame/ResizeViewportAnchor.h"
63 #include "core/frame/RotationViewportAnchor.h" 64 #include "core/frame/RotationViewportAnchor.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // static 331 // static
331 HashSet<WebViewBase*>& WebViewBase::AllInstances() { 332 HashSet<WebViewBase*>& WebViewBase::AllInstances() {
332 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ()); 333 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ());
333 return all_instances; 334 return all_instances;
334 } 335 }
335 336
336 WebViewImpl::WebViewImpl(WebViewClient* client, 337 WebViewImpl::WebViewImpl(WebViewClient* client,
337 WebPageVisibilityState visibility_state) 338 WebPageVisibilityState visibility_state)
338 : client_(client), 339 : client_(client),
339 spell_check_client_(nullptr), 340 spell_check_client_(nullptr),
340 chrome_client_impl_(ChromeClientImpl::Create(this)), 341 chrome_client_(WebFactory::GetInstance().CreateChromeClient(this)),
341 context_menu_client_impl_(this), 342 context_menu_client_impl_(this),
342 editor_client_impl_(this), 343 editor_client_impl_(this),
343 spell_checker_client_impl_(this), 344 spell_checker_client_impl_(this),
344 storage_client_impl_(this), 345 storage_client_impl_(this),
345 should_auto_resize_(false), 346 should_auto_resize_(false),
346 zoom_level_(0), 347 zoom_level_(0),
347 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), 348 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)),
348 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)), 349 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)),
349 zoom_factor_for_device_scale_factor_(0.f), 350 zoom_factor_for_device_scale_factor_(0.f),
350 maximum_legible_scale_(1), 351 maximum_legible_scale_(1),
(...skipping 28 matching lines...) Expand all
379 elastic_overscroll_(FloatSize()), 380 elastic_overscroll_(FloatSize()),
380 mutator_(nullptr), 381 mutator_(nullptr),
381 scheduler_(WTF::WrapUnique(Platform::Current() 382 scheduler_(WTF::WrapUnique(Platform::Current()
382 ->CurrentThread() 383 ->CurrentThread()
383 ->Scheduler() 384 ->Scheduler()
384 ->CreateWebViewScheduler(this, this) 385 ->CreateWebViewScheduler(this, this)
385 .release())), 386 .release())),
386 last_frame_time_monotonic_(0), 387 last_frame_time_monotonic_(0),
387 override_compositor_visibility_(false) { 388 override_compositor_visibility_(false) {
388 Page::PageClients page_clients; 389 Page::PageClients page_clients;
389 page_clients.chrome_client = chrome_client_impl_.Get(); 390 page_clients.chrome_client = chrome_client_.Get();
390 page_clients.context_menu_client = &context_menu_client_impl_; 391 page_clients.context_menu_client = &context_menu_client_impl_;
391 page_clients.editor_client = &editor_client_impl_; 392 page_clients.editor_client = &editor_client_impl_;
392 page_clients.spell_checker_client = &spell_checker_client_impl_; 393 page_clients.spell_checker_client = &spell_checker_client_impl_;
393 394
394 page_ = Page::CreateOrdinary(page_clients); 395 page_ = Page::CreateOrdinary(page_clients);
395 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_); 396 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_);
396 ProvideSpeechRecognitionTo( 397 ProvideSpeechRecognitionTo(
397 *page_, SpeechRecognitionClientProxy::Create( 398 *page_, SpeechRecognitionClientProxy::Create(
398 client ? client->SpeechRecognizer() : nullptr)); 399 client ? client->SpeechRecognizer() : nullptr));
399 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create()); 400 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create());
(...skipping 3747 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4148 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4148 return nullptr; 4149 return nullptr;
4149 return focused_frame; 4150 return focused_frame;
4150 } 4151 }
4151 4152
4152 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4153 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4153 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4154 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4154 } 4155 }
4155 4156
4156 } // namespace blink 4157 } // namespace blink
OLDNEW
« no previous file with comments | « 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