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

Side by Side Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 671653002: Standardize usage of virtual/override/final in chrome/browser/ui/ (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/ui/webui/print_preview/print_preview_handler.h" 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h"
6 6
7 #include <ctype.h> 7 #include <ctype.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 printing::PrintBackend::CreateInstance(NULL)); 294 printing::PrintBackend::CreateInstance(NULL));
295 295
296 std::string default_printer = print_backend->GetDefaultPrinterName(); 296 std::string default_printer = print_backend->GetDefaultPrinterName();
297 VLOG(1) << "Default Printer: " << default_printer; 297 VLOG(1) << "Default Printer: " << default_printer;
298 return default_printer; 298 return default_printer;
299 } 299 }
300 300
301 class PrintingContextDelegate : public printing::PrintingContext::Delegate { 301 class PrintingContextDelegate : public printing::PrintingContext::Delegate {
302 public: 302 public:
303 // PrintingContext::Delegate methods. 303 // PrintingContext::Delegate methods.
304 virtual gfx::NativeView GetParentView() override { return NULL; } 304 gfx::NativeView GetParentView() override { return NULL; }
305 virtual std::string GetAppLocale() override { 305 std::string GetAppLocale() override {
306 return g_browser_process->GetApplicationLocale(); 306 return g_browser_process->GetApplicationLocale();
307 } 307 }
308 }; 308 };
309 309
310 gfx::Size GetDefaultPdfMediaSizeMicrons() { 310 gfx::Size GetDefaultPdfMediaSizeMicrons() {
311 PrintingContextDelegate delegate; 311 PrintingContextDelegate delegate;
312 scoped_ptr<printing::PrintingContext> printing_context( 312 scoped_ptr<printing::PrintingContext> printing_context(
313 printing::PrintingContext::Create(&delegate)); 313 printing::PrintingContext::Create(&delegate));
314 if (printing::PrintingContext::OK != printing_context->UsePdfSettings() || 314 if (printing::PrintingContext::OK != printing_context->UsePdfSettings() ||
315 printing_context->settings().device_units_per_inch() <= 0) { 315 printing_context->settings().device_units_per_inch() <= 0) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 OAuth2TokenService::ScopeSet oauth_scopes; 532 OAuth2TokenService::ScopeSet oauth_scopes;
533 oauth_scopes.insert(cloud_devices::kCloudPrintAuthScope); 533 oauth_scopes.insert(cloud_devices::kCloudPrintAuthScope);
534 scoped_ptr<OAuth2TokenService::Request> request( 534 scoped_ptr<OAuth2TokenService::Request> request(
535 service->StartRequest(account_id, oauth_scopes, this)); 535 service->StartRequest(account_id, oauth_scopes, this));
536 requests_[type].reset(request.release()); 536 requests_[type].reset(request.release());
537 } else { 537 } else {
538 handler_->SendAccessToken(type, std::string()); // Unknown type. 538 handler_->SendAccessToken(type, std::string()); // Unknown type.
539 } 539 }
540 } 540 }
541 541
542 virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, 542 void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
543 const std::string& access_token, 543 const std::string& access_token,
544 const base::Time& expiration_time) override { 544 const base::Time& expiration_time) override {
545 OnServiceResponce(request, access_token); 545 OnServiceResponce(request, access_token);
546 } 546 }
547 547
548 virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request, 548 void OnGetTokenFailure(const OAuth2TokenService::Request* request,
549 const GoogleServiceAuthError& error) override { 549 const GoogleServiceAuthError& error) override {
550 OnServiceResponce(request, std::string()); 550 OnServiceResponce(request, std::string());
551 } 551 }
552 552
553 private: 553 private:
554 void OnServiceResponce(const OAuth2TokenService::Request* request, 554 void OnServiceResponce(const OAuth2TokenService::Request* request,
555 const std::string& access_token) { 555 const std::string& access_token) {
556 for (Requests::iterator i = requests_.begin(); i != requests_.end(); ++i) { 556 for (Requests::iterator i = requests_.begin(); i != requests_.end(); ++i) {
557 if (i->second == request) { 557 if (i->second == request) {
558 handler_->SendAccessToken(i->first, access_token); 558 handler_->SendAccessToken(i->first, access_token);
559 requests_.erase(i); 559 requests_.erase(i);
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 1630
1631 void PrintPreviewHandler::UnregisterForMergeSession() { 1631 void PrintPreviewHandler::UnregisterForMergeSession() {
1632 if (reconcilor_) 1632 if (reconcilor_)
1633 reconcilor_->RemoveMergeSessionObserver(this); 1633 reconcilor_->RemoveMergeSessionObserver(this);
1634 } 1634 }
1635 1635
1636 void PrintPreviewHandler::SetPdfSavedClosureForTesting( 1636 void PrintPreviewHandler::SetPdfSavedClosureForTesting(
1637 const base::Closure& closure) { 1637 const base::Closure& closure) {
1638 pdf_file_saved_closure_ = closure; 1638 pdf_file_saved_closure_ = closure;
1639 } 1639 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698