Skip to content

Commit

Permalink
Replace Cloud Print WebUI dialog with regular tab
Browse files Browse the repository at this point in the history
WebUI should not open external pages.
New implementation just opens new tab and injects document
from attaches WebContents observer.

BUG=408684

Review URL: https://codereview.chromium.org/1219513003

Cr-Commit-Position: refs/heads/master@{#336452}
  • Loading branch information
vitalybuka authored and Commit bot committed Jun 26, 2015
1 parent 08141d9 commit 66de8e3
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 1,333 deletions.
700 changes: 4 additions & 696 deletions chrome/browser/printing/print_dialog_cloud.cc

Large diffs are not rendered by default.

44 changes: 6 additions & 38 deletions chrome/browser/printing/print_dialog_cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,21 @@

#include "base/basictypes.h"
#include "base/callback.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string16.h"
#include "ui/gfx/native_widget_types.h"

class Browser;
class Profile;

namespace base {
class CommandLine;
class FilePath;
}

namespace content {
class BrowserContext;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace print_dialog_cloud {

void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

// Creates a print dialog to print a file on disk.
// Called on the FILE or UI thread. Even though this may start up a modal
// dialog, it will return immediately. The dialog is handled asynchronously.
// If non-NULL, |modal_parent| specifies a window that the print dialog is modal
// to.
void CreatePrintDialogForFile(content::BrowserContext* browser_context,
gfx::NativeView modal_parent,
const base::FilePath& path_to_file,
const base::string16& print_job_title,
const base::string16& print_ticket,
const std::string& file_type);

// Creates a print dialog to print data in RAM.
// Called on the FILE or UI thread. Even though this may start up a modal
// dialog, it will return immediately. The dialog is handled asynchronously.
// If non-NULL, |modal_parent| specifies a window that the print dialog is modal
// to.
void CreatePrintDialogForBytes(content::BrowserContext* browser_context,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const base::string16& print_job_title,
const base::string16& print_ticket,
const std::string& file_type);

// Parse switches from command_line and display the print dialog as appropriate.
bool CreatePrintDialogFromCommandLine(Profile* profile,
const base::CommandLine& command_line);
// TODO(vitalybuka): Remove related prefs.
inline void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {}

// Creates a tab with Google 'sign in' or 'add account' page, based on
// passed |add_account| value.
Expand All @@ -68,6 +32,10 @@ void CreateCloudPrintSigninTab(Browser* browser,
bool add_account,
const base::Closure& callback);

// Parse switches from command_line and display the print dialog as appropriate.
bool CreatePrintDialogFromCommandLine(Profile* profile,
const base::CommandLine& command_line);

} // namespace print_dialog_cloud

#endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_
200 changes: 0 additions & 200 deletions chrome/browser/printing/print_dialog_cloud_internal.h

This file was deleted.

17 changes: 17 additions & 0 deletions chrome/browser/printing/print_dialog_cloud_posix.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/printing/print_dialog_cloud.h"

#include "base/logging.h"

namespace print_dialog_cloud {

bool CreatePrintDialogFromCommandLine(Profile* profile,
const base::CommandLine& command_line) {
NOTIMPLEMENTED();
return false;
}

} // namespace print_dialog_cloud
Loading

0 comments on commit 66de8e3

Please sign in to comment.