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

Side by Side Diff: components/dom_distiller/content/browser/web_contents_main_frame_observer.h

Issue 2663333004: Convert dom_distiller::WebContentsMainFrameObserver to use the new navigation callbacks. (Closed)
Patch Set: undo testing change Created 3 years, 10 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 | components/dom_distiller/content/browser/web_contents_main_frame_observer.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSERVE R_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSERVE R_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSERVE R_H_ 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSERVE R_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
(...skipping 12 matching lines...) Expand all
23 23
24 bool is_document_loaded_in_main_frame() { 24 bool is_document_loaded_in_main_frame() {
25 return is_document_loaded_in_main_frame_; 25 return is_document_loaded_in_main_frame_;
26 } 26 }
27 27
28 bool is_initialized() { return is_initialized_; } 28 bool is_initialized() { return is_initialized_; }
29 29
30 // content::WebContentsObserver implementation. 30 // content::WebContentsObserver implementation.
31 void DocumentLoadedInFrame( 31 void DocumentLoadedInFrame(
32 content::RenderFrameHost* render_frame_host) override; 32 content::RenderFrameHost* render_frame_host) override;
33 void DidNavigateMainFrame( 33 void DidFinishNavigation(
34 const content::LoadCommittedDetails& details, 34 content::NavigationHandle* navigation_handle) override;
35 const content::FrameNavigateParams& params) override;
36 void RenderProcessGone(base::TerminationStatus status) override; 35 void RenderProcessGone(base::TerminationStatus status) override;
37 36
38 private: 37 private:
39 explicit WebContentsMainFrameObserver(content::WebContents* web_contents); 38 explicit WebContentsMainFrameObserver(content::WebContents* web_contents);
40 friend class content::WebContentsUserData<WebContentsMainFrameObserver>; 39 friend class content::WebContentsUserData<WebContentsMainFrameObserver>;
41 40
42 // Removes the observer and clears the WebContents member. 41 // Removes the observer and clears the WebContents member.
43 void CleanUp(); 42 void CleanUp();
44 43
45 // Whether DocumentLoadedInFrame has been called for the tracked WebContents 44 // Whether DocumentLoadedInFrame has been called for the tracked WebContents
46 // for the current main frame. This is cleared when the main frame navigates, 45 // for the current main frame. This is cleared when the main frame navigates,
47 // and set again when DocumentLoadedInFrame is called for the main frame. 46 // and set again when DocumentLoadedInFrame is called for the main frame.
48 bool is_document_loaded_in_main_frame_; 47 bool is_document_loaded_in_main_frame_;
49 48
50 // Whether this object has been correctly initialized. This is set as soon as 49 // Whether this object has been correctly initialized. This is set as soon as
51 // at least one call to DidNavigateMainFrame has happened. 50 // at least one call to DidNavigateMainFrame has happened.
52 bool is_initialized_; 51 bool is_initialized_;
53 52
54 DISALLOW_COPY_AND_ASSIGN(WebContentsMainFrameObserver); 53 DISALLOW_COPY_AND_ASSIGN(WebContentsMainFrameObserver);
55 }; 54 };
56 55
57 } // namespace dom_distiller 56 } // namespace dom_distiller
58 57
59 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSE RVER_H_ 58 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_WEB_CONTENTS_MAIN_FRAME_OBSE RVER_H_
OLDNEW
« no previous file with comments | « no previous file | components/dom_distiller/content/browser/web_contents_main_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698