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: Review feedback as discussed 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
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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // static 333 // static
333 HashSet<WebViewBase*>& WebViewBase::AllInstances() { 334 HashSet<WebViewBase*>& WebViewBase::AllInstances() {
334 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ()); 335 DEFINE_STATIC_LOCAL(HashSet<WebViewBase*>, all_instances, ());
335 return all_instances; 336 return all_instances;
336 } 337 }
337 338
338 WebViewImpl::WebViewImpl(WebViewClient* client, 339 WebViewImpl::WebViewImpl(WebViewClient* client,
339 WebPageVisibilityState visibility_state) 340 WebPageVisibilityState visibility_state)
340 : client_(client), 341 : client_(client),
341 spell_check_client_(nullptr), 342 spell_check_client_(nullptr),
342 chrome_client_impl_(ChromeClientImpl::Create(this)), 343 chrome_client_(WebFactory::GetInstance().CreateChromeClient(this)),
343 context_menu_client_impl_(this), 344 context_menu_client_impl_(this),
344 editor_client_impl_(this), 345 editor_client_impl_(this),
345 spell_checker_client_impl_(this), 346 spell_checker_client_impl_(this),
346 storage_client_impl_(this), 347 storage_client_impl_(this),
347 should_auto_resize_(false), 348 should_auto_resize_(false),
348 zoom_level_(0), 349 zoom_level_(0),
349 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), 350 minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)),
350 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)), 351 maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)),
351 zoom_factor_for_device_scale_factor_(0.f), 352 zoom_factor_for_device_scale_factor_(0.f),
352 maximum_legible_scale_(1), 353 maximum_legible_scale_(1),
(...skipping 28 matching lines...) Expand all
381 elastic_overscroll_(FloatSize()), 382 elastic_overscroll_(FloatSize()),
382 mutator_(nullptr), 383 mutator_(nullptr),
383 scheduler_(WTF::WrapUnique(Platform::Current() 384 scheduler_(WTF::WrapUnique(Platform::Current()
384 ->CurrentThread() 385 ->CurrentThread()
385 ->Scheduler() 386 ->Scheduler()
386 ->CreateWebViewScheduler(this, this) 387 ->CreateWebViewScheduler(this, this)
387 .release())), 388 .release())),
388 last_frame_time_monotonic_(0), 389 last_frame_time_monotonic_(0),
389 override_compositor_visibility_(false) { 390 override_compositor_visibility_(false) {
390 Page::PageClients page_clients; 391 Page::PageClients page_clients;
391 page_clients.chrome_client = chrome_client_impl_.Get(); 392 page_clients.chrome_client = chrome_client_.Get();
392 page_clients.context_menu_client = &context_menu_client_impl_; 393 page_clients.context_menu_client = &context_menu_client_impl_;
393 page_clients.editor_client = &editor_client_impl_; 394 page_clients.editor_client = &editor_client_impl_;
394 page_clients.spell_checker_client = &spell_checker_client_impl_; 395 page_clients.spell_checker_client = &spell_checker_client_impl_;
395 396
396 page_ = Page::CreateOrdinary(page_clients); 397 page_ = Page::CreateOrdinary(page_clients);
397 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_); 398 MediaKeysController::ProvideMediaKeysTo(*page_, &media_keys_client_impl_);
398 ProvideSpeechRecognitionTo( 399 ProvideSpeechRecognitionTo(
399 *page_, SpeechRecognitionClientProxy::Create( 400 *page_, SpeechRecognitionClientProxy::Create(
400 client ? client->SpeechRecognizer() : nullptr)); 401 client ? client->SpeechRecognizer() : nullptr));
401 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create()); 402 ProvideContextFeaturesTo(*page_, ContextFeaturesClientImpl::Create());
(...skipping 3745 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
« 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