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

Side by Side Diff: blimp/engine/session/blimp_engine_session.cc

Issue 1885673003: Create and integrate a metrics service client into Blimp engine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment follow ups. TODO: client unittest and additional refactoring. Created 4 years, 8 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "blimp/engine/session/blimp_engine_session.h" 5 #include "blimp/engine/session/blimp_engine_session.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 render_widget_feature_(settings_manager_), 210 render_widget_feature_(settings_manager_),
211 net_components_( 211 net_components_(
212 new EngineNetworkComponents(net_log, 212 new EngineNetworkComponents(net_log,
213 QuitCurrentMessageLoopClosure())) { 213 QuitCurrentMessageLoopClosure())) {
214 DCHECK(engine_config_); 214 DCHECK(engine_config_);
215 DCHECK(settings_manager_); 215 DCHECK(settings_manager_);
216 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor, 216 screen_->UpdateDisplayScaleAndSize(kDefaultScaleFactor,
217 gfx::Size(kDefaultDisplayWidth, 217 gfx::Size(kDefaultDisplayWidth,
218 kDefaultDisplayHeight)); 218 kDefaultDisplayHeight));
219 render_widget_feature_.SetDelegate(kDummyTabId, this); 219 render_widget_feature_.SetDelegate(kDummyTabId, this);
220
221 // Initializes the PrefService and MetricsServiceClient for Blimp.
222 browser_context_->Initialize();
220 } 223 }
221 224
222 BlimpEngineSession::~BlimpEngineSession() { 225 BlimpEngineSession::~BlimpEngineSession() {
226 browser_context_->Finalize();
227
223 render_widget_feature_.RemoveDelegate(kDummyTabId); 228 render_widget_feature_.RemoveDelegate(kDummyTabId);
224 229
225 window_tree_host_->GetInputMethod()->RemoveObserver(this); 230 window_tree_host_->GetInputMethod()->RemoveObserver(this);
226 231
227 // Ensure that all WebContents are torn down first, since teardown will 232 // Ensure that all WebContents are torn down first, since teardown will
228 // trigger RenderViewDeleted callbacks to their observers. 233 // trigger RenderViewDeleted callbacks to their observers.
229 web_contents_.reset(); 234 web_contents_.reset();
230 235
231 // Safely delete network components on the IO thread. 236 // Safely delete network components on the IO thread.
232 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, 237 content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 638
634 aura::Window* parent = window_tree_host_->window(); 639 aura::Window* parent = window_tree_host_->window();
635 aura::Window* content = web_contents_->GetNativeView(); 640 aura::Window* content = web_contents_->GetNativeView();
636 if (!parent->Contains(content)) 641 if (!parent->Contains(content))
637 parent->AddChild(content); 642 parent->AddChild(content);
638 content->Show(); 643 content->Show();
639 } 644 }
640 645
641 } // namespace engine 646 } // namespace engine
642 } // namespace blimp 647 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698