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

Unified Diff: chrome/browser/printing/print_preview_tab_controller.cc

Issue 10068036: RefCounted types should not have public destructors, chrome/browser/ part 5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win fix Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_preview_tab_controller.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_preview_tab_controller.cc
diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc
index 763320be42fa13e4182360b7fb287dc70304acb9..7f2efba5472acf8d913a97654f0fc6e8d97a46ba 100644
--- a/chrome/browser/printing/print_preview_tab_controller.cc
+++ b/chrome/browser/printing/print_preview_tab_controller.cc
@@ -198,8 +198,6 @@ PrintPreviewTabController::PrintPreviewTabController()
is_creating_print_preview_tab_(false) {
}
-PrintPreviewTabController::~PrintPreviewTabController() {}
-
// static
PrintPreviewTabController* PrintPreviewTabController::GetInstance() {
if (!g_browser_process)
@@ -251,6 +249,14 @@ TabContentsWrapper* PrintPreviewTabController::GetPrintPreviewForTab(
return NULL;
}
+TabContentsWrapper* PrintPreviewTabController::GetInitiatorTab(
+ TabContentsWrapper* preview_tab) {
+ PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab);
+ if (it != preview_tab_map_.end())
+ return preview_tab_map_[preview_tab];
+ return NULL;
+}
+
void PrintPreviewTabController::Observe(
int type,
const content::NotificationSource& source,
@@ -286,6 +292,33 @@ void PrintPreviewTabController::Observe(
}
}
+// static
+bool PrintPreviewTabController::IsPrintPreviewTab(TabContentsWrapper* tab) {
+ return IsPrintPreviewURL(tab->web_contents()->GetURL());
+}
+
+// static
+bool PrintPreviewTabController::IsPrintPreviewURL(const GURL& url) {
+ return (url.SchemeIs(chrome::kChromeUIScheme) &&
+ url.host() == chrome::kChromeUIPrintHost);
+}
+
+void PrintPreviewTabController::EraseInitiatorTabInfo(
+ TabContentsWrapper* preview_tab) {
+ PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab);
+ if (it == preview_tab_map_.end())
+ return;
+
+ RemoveObservers(it->second);
+ preview_tab_map_[preview_tab] = NULL;
+}
+
+bool PrintPreviewTabController::is_creating_print_preview_tab() const {
+ return is_creating_print_preview_tab_;
+}
+
+PrintPreviewTabController::~PrintPreviewTabController() {}
+
void PrintPreviewTabController::OnRendererProcessClosed(
content::RenderProcessHost* rph) {
// Store tabs in a vector and deal with them after iterating through
@@ -371,39 +404,6 @@ void PrintPreviewTabController::OnNavEntryCommitted(
RemoveInitiatorTab(tab, true);
}
-// static
-bool PrintPreviewTabController::IsPrintPreviewTab(TabContentsWrapper* tab) {
- return IsPrintPreviewURL(tab->web_contents()->GetURL());
-}
-
-// static
-bool PrintPreviewTabController::IsPrintPreviewURL(const GURL& url) {
- return (url.SchemeIs(chrome::kChromeUIScheme) &&
- url.host() == chrome::kChromeUIPrintHost);
-}
-
-void PrintPreviewTabController::EraseInitiatorTabInfo(
- TabContentsWrapper* preview_tab) {
- PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab);
- if (it == preview_tab_map_.end())
- return;
-
- RemoveObservers(it->second);
- preview_tab_map_[preview_tab] = NULL;
-}
-
-bool PrintPreviewTabController::is_creating_print_preview_tab() const {
- return is_creating_print_preview_tab_;
-}
-
-TabContentsWrapper* PrintPreviewTabController::GetInitiatorTab(
- TabContentsWrapper* preview_tab) {
- PrintPreviewTabMap::iterator it = preview_tab_map_.find(preview_tab);
- if (it != preview_tab_map_.end())
- return preview_tab_map_[preview_tab];
- return NULL;
-}
-
TabContentsWrapper* PrintPreviewTabController::CreatePrintPreviewTab(
TabContentsWrapper* initiator_tab) {
AutoReset<bool> auto_reset(&is_creating_print_preview_tab_, true);
« no previous file with comments | « chrome/browser/printing/print_preview_tab_controller.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698