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

Side by Side Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 668093002: Standardize usage of virtual/override/final in chrome/browser/printing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/printing/print_dialog_cloud.h" 5 #include "chrome/browser/printing/print_dialog_cloud.h"
6 6
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 GURL cloud_print_url, 136 GURL cloud_print_url,
137 const base::Closure& callback) 137 const base::Closure& callback)
138 : WebContentsObserver(web_contents), 138 : WebContentsObserver(web_contents),
139 cloud_print_url_(cloud_print_url), 139 cloud_print_url_(cloud_print_url),
140 callback_(callback), 140 callback_(callback),
141 weak_ptr_factory_(this) { 141 weak_ptr_factory_(this) {
142 } 142 }
143 143
144 private: 144 private:
145 // Overridden from content::WebContentsObserver: 145 // Overridden from content::WebContentsObserver:
146 virtual void DidNavigateMainFrame( 146 void DidNavigateMainFrame(
147 const content::LoadCommittedDetails& details, 147 const content::LoadCommittedDetails& details,
148 const content::FrameNavigateParams& params) override { 148 const content::FrameNavigateParams& params) override {
149 if (IsSimilarUrl(params.url, cloud_print_url_)) { 149 if (IsSimilarUrl(params.url, cloud_print_url_)) {
150 base::MessageLoop::current()->PostTask( 150 base::MessageLoop::current()->PostTask(
151 FROM_HERE, 151 FROM_HERE,
152 base::Bind(&SignInObserver::OnSignIn, 152 base::Bind(&SignInObserver::OnSignIn,
153 weak_ptr_factory_.GetWeakPtr())); 153 weak_ptr_factory_.GetWeakPtr()));
154 } 154 }
155 } 155 }
156 156
157 virtual void WebContentsDestroyed() override { 157 void WebContentsDestroyed() override { delete this; }
158 delete this;
159 }
160 158
161 void OnSignIn() { 159 void OnSignIn() {
162 callback_.Run(); 160 callback_.Run();
163 if (web_contents()) 161 if (web_contents())
164 web_contents()->Close(); 162 web_contents()->Close();
165 } 163 }
166 164
167 GURL cloud_print_url_; 165 GURL cloud_print_url_;
168 base::Closure callback_; 166 base::Closure callback_;
169 base::WeakPtrFactory<SignInObserver> weak_ptr_factory_; 167 base::WeakPtrFactory<SignInObserver> weak_ptr_factory_;
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 775
778 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL, 776 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL,
779 cloud_print_file, print_job_title, print_job_print_ticket, file_type); 777 cloud_print_file, print_job_title, print_job_print_ticket, file_type);
780 return true; 778 return true;
781 } 779 }
782 } 780 }
783 return false; 781 return false;
784 } 782 }
785 783
786 } // namespace print_dialog_cloud 784 } // namespace print_dialog_cloud
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698