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

Side by Side Diff: blimp/client/core/contents/blimp_navigation_controller_impl.cc

Issue 2313133002: Fix crashers and issues when rendering blimp in tabs (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | blimp/client/core/contents/tab_control_feature.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/client/core/contents/blimp_navigation_controller_impl.h" 5 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h"
6 6
7 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" 7 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h"
8 8
9 namespace { 9 namespace {
10 // TODO(shaktisahu): NavigationFeature currently needs a tab_id. Remove this 10 // TODO(shaktisahu): NavigationFeature currently needs a tab_id. Remove this
11 // later when it is fully integrated with BlimpClientContext. 11 // later when it is fully integrated with BlimpClientContext.
12 const int kDummyTabId = 0; 12 const int kDummyTabId = 0;
13 } // namespace 13 } // namespace
14 14
15 namespace blimp { 15 namespace blimp {
16 namespace client { 16 namespace client {
17 17
18 BlimpNavigationControllerImpl::BlimpNavigationControllerImpl( 18 BlimpNavigationControllerImpl::BlimpNavigationControllerImpl(
19 BlimpNavigationControllerDelegate* delegate, 19 BlimpNavigationControllerDelegate* delegate,
20 NavigationFeature* feature) 20 NavigationFeature* feature)
21 : navigation_feature_(feature), delegate_(delegate) { 21 : navigation_feature_(feature), delegate_(delegate) {
22 if (navigation_feature_) 22 if (navigation_feature_)
23 navigation_feature_->SetDelegate(kDummyTabId, this); 23 navigation_feature_->SetDelegate(kDummyTabId, this);
24 } 24 }
25 25
26 BlimpNavigationControllerImpl::~BlimpNavigationControllerImpl() = default; 26 BlimpNavigationControllerImpl::~BlimpNavigationControllerImpl() {
27 if (navigation_feature_)
28 navigation_feature_->RemoveDelegate(kDummyTabId);
29 }
27 30
28 void BlimpNavigationControllerImpl::LoadURL(const GURL& url) { 31 void BlimpNavigationControllerImpl::LoadURL(const GURL& url) {
29 current_url_ = url; 32 current_url_ = url;
30 navigation_feature_->NavigateToUrlText(kDummyTabId, current_url_.spec()); 33 navigation_feature_->NavigateToUrlText(kDummyTabId, current_url_.spec());
31 } 34 }
32 35
33 void BlimpNavigationControllerImpl::Reload() { 36 void BlimpNavigationControllerImpl::Reload() {
34 navigation_feature_->Reload(kDummyTabId); 37 navigation_feature_->Reload(kDummyTabId);
35 } 38 }
36 39
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 delegate_->OnLoadingStateChanged(loading); 84 delegate_->OnLoadingStateChanged(loading);
82 } 85 }
83 86
84 void BlimpNavigationControllerImpl::OnPageLoadStatusUpdate(int tab_id, 87 void BlimpNavigationControllerImpl::OnPageLoadStatusUpdate(int tab_id,
85 bool completed) { 88 bool completed) {
86 delegate_->OnNavigationStateChanged(); 89 delegate_->OnNavigationStateChanged();
87 } 90 }
88 91
89 } // namespace client 92 } // namespace client
90 } // namespace blimp 93 } // namespace blimp
OLDNEW
« no previous file with comments | « no previous file | blimp/client/core/contents/tab_control_feature.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698