GTK: Rename ambiguous "exceptions_page_gtk.cc" before making the content exceptions page.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/597051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38953 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/gtk/options/exceptions_page_gtk.cc b/chrome/browser/gtk/options/passwords_exceptions_page_gtk.cc
similarity index 84%
rename from chrome/browser/gtk/options/exceptions_page_gtk.cc
rename to chrome/browser/gtk/options/passwords_exceptions_page_gtk.cc
index 2d29dfc..7d77726 100644
--- a/chrome/browser/gtk/options/exceptions_page_gtk.cc
+++ b/chrome/browser/gtk/options/passwords_exceptions_page_gtk.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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/gtk/options/exceptions_page_gtk.h"
+#include "chrome/browser/gtk/options/passwords_exceptions_page_gtk.h"
#include "app/gfx/gtk_util.h"
#include "app/l10n_util.h"
@@ -28,9 +28,9 @@
} // anonymous namespace
///////////////////////////////////////////////////////////////////////////////
-// ExceptionsPageGtk, public:
+// PasswordsExceptionsPageGtk, public:
-ExceptionsPageGtk::ExceptionsPageGtk(Profile* profile)
+PasswordsExceptionsPageGtk::PasswordsExceptionsPageGtk(Profile* profile)
: populater(this), profile_(profile) {
remove_button_ = gtk_button_new_with_label(
@@ -65,13 +65,13 @@
gtk_box_pack_end(GTK_BOX(page_), scroll_window, TRUE, TRUE, 0);
}
-ExceptionsPageGtk::~ExceptionsPageGtk() {
+PasswordsExceptionsPageGtk::~PasswordsExceptionsPageGtk() {
}
///////////////////////////////////////////////////////////////////////////////
-// ExceptionsPageGtk, private:
+// PasswordsExceptionsPageGtk, private:
-void ExceptionsPageGtk::InitExceptionTree() {
+void PasswordsExceptionsPageGtk::InitExceptionTree() {
exception_list_store_ = gtk_list_store_new(COL_COUNT, G_TYPE_STRING);
exception_list_sort_ = gtk_tree_model_sort_new_with_model(
GTK_TREE_MODEL(exception_list_store_));
@@ -100,11 +100,11 @@
populater.populate();
}
-PasswordStore* ExceptionsPageGtk::GetPasswordStore() {
+PasswordStore* PasswordsExceptionsPageGtk::GetPasswordStore() {
return profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS);
}
-void ExceptionsPageGtk::SetExceptionList(
+void PasswordsExceptionsPageGtk::SetExceptionList(
const std::vector<webkit_glue::PasswordForm*>& result) {
std::wstring languages =
profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
@@ -123,8 +123,9 @@
}
// static
-void ExceptionsPageGtk::OnRemoveButtonClicked(GtkButton* widget,
- ExceptionsPageGtk* page) {
+void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(
+ GtkButton* widget,
+ PasswordsExceptionsPageGtk* page) {
GtkTreeIter iter;
if (!gtk_tree_selection_get_selected(page->exception_selection_,
NULL, &iter)) {
@@ -152,8 +153,9 @@
}
// static
-void ExceptionsPageGtk::OnRemoveAllButtonClicked(GtkButton* widget,
- ExceptionsPageGtk* page) {
+void PasswordsExceptionsPageGtk::OnRemoveAllButtonClicked(
+ GtkButton* widget,
+ PasswordsExceptionsPageGtk* page) {
// Remove from GTK list, DB, and vector.
PasswordStore* store = page->GetPasswordStore();
gtk_list_store_clear(page->exception_list_store_);
@@ -165,8 +167,9 @@
}
// static
-void ExceptionsPageGtk::OnExceptionSelectionChanged(GtkTreeSelection* selection,
- ExceptionsPageGtk* page) {
+void PasswordsExceptionsPageGtk::OnExceptionSelectionChanged(
+ GtkTreeSelection* selection,
+ PasswordsExceptionsPageGtk* page) {
GtkTreeIter iter;
if (!gtk_tree_selection_get_selected(selection, NULL, &iter)) {
gtk_widget_set_sensitive(page->remove_button_, FALSE);
@@ -176,23 +179,25 @@
}
// static
-gint ExceptionsPageGtk::CompareSite(GtkTreeModel* model,
+gint PasswordsExceptionsPageGtk::CompareSite(GtkTreeModel* model,
GtkTreeIter* a, GtkTreeIter* b,
gpointer window) {
int row1 = gtk_tree::GetRowNumForIter(model, a);
int row2 = gtk_tree::GetRowNumForIter(model, b);
- ExceptionsPageGtk* page = reinterpret_cast<ExceptionsPageGtk*>(window);
+ PasswordsExceptionsPageGtk* page =
+ reinterpret_cast<PasswordsExceptionsPageGtk*>(window);
return page->exception_list_[row1].origin.spec().compare(
page->exception_list_[row2].origin.spec());
}
-void ExceptionsPageGtk::ExceptionListPopulater::populate() {
+void PasswordsExceptionsPageGtk::ExceptionListPopulater::populate() {
DCHECK(!pending_login_query_);
PasswordStore* store = page_->GetPasswordStore();
pending_login_query_ = store->GetBlacklistLogins(this);
}
-void ExceptionsPageGtk::ExceptionListPopulater::OnPasswordStoreRequestDone(
+void
+PasswordsExceptionsPageGtk::ExceptionListPopulater::OnPasswordStoreRequestDone(
int handle, const std::vector<webkit_glue::PasswordForm*>& result) {
DCHECK_EQ(pending_login_query_, handle);
pending_login_query_ = 0;
diff --git a/chrome/browser/gtk/options/exceptions_page_gtk.h b/chrome/browser/gtk/options/passwords_exceptions_page_gtk.h
similarity index 63%
rename from chrome/browser/gtk/options/exceptions_page_gtk.h
rename to chrome/browser/gtk/options/passwords_exceptions_page_gtk.h
index 67ae0a7..b226f0f 100644
--- a/chrome/browser/gtk/options/exceptions_page_gtk.h
+++ b/chrome/browser/gtk/options/passwords_exceptions_page_gtk.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
-#ifndef CHROME_BROWSER_GTK_OPTIONS_EXCEPTIONS_PAGE_GTK_H_
-#define CHROME_BROWSER_GTK_OPTIONS_EXCEPTIONS_PAGE_GTK_H_
+#ifndef CHROME_BROWSER_GTK_OPTIONS_PASSWORDS_EXCEPTIONS_PAGE_GTK_H_
+#define CHROME_BROWSER_GTK_OPTIONS_PASSWORDS_EXCEPTIONS_PAGE_GTK_H_
#include <gtk/gtk.h>
@@ -12,10 +12,13 @@
#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/profile.h"
-class ExceptionsPageGtk {
+// A page in the show saved passwords dialog that lists what sites we never
+// show passwords for, with controls for the user to add/remove sites from that
+// list.
+class PasswordsExceptionsPageGtk {
public:
- explicit ExceptionsPageGtk(Profile* profile);
- ~ExceptionsPageGtk();
+ explicit PasswordsExceptionsPageGtk(Profile* profile);
+ ~PasswordsExceptionsPageGtk();
GtkWidget* get_page_widget() const {
return page_;
@@ -32,15 +35,16 @@
void SetExceptionList(const std::vector<webkit_glue::PasswordForm*>& result);
// Callback for the remove button.
- static void OnRemoveButtonClicked(GtkButton* widget, ExceptionsPageGtk* page);
+ static void OnRemoveButtonClicked(GtkButton* widget,
+ PasswordsExceptionsPageGtk* page);
// Callback for the remove all button.
static void OnRemoveAllButtonClicked(GtkButton* widget,
- ExceptionsPageGtk* page);
+ PasswordsExceptionsPageGtk* page);
// Callback for selection changed events.
static void OnExceptionSelectionChanged(GtkTreeSelection* selection,
- ExceptionsPageGtk* page);
+ PasswordsExceptionsPageGtk* page);
// Sorting function.
static gint CompareSite(GtkTreeModel* model,
@@ -50,20 +54,21 @@
// A short class to mediate requests to the password store.
class ExceptionListPopulater : public PasswordStoreConsumer {
public:
- explicit ExceptionListPopulater(ExceptionsPageGtk* page)
+ explicit ExceptionListPopulater(PasswordsExceptionsPageGtk* page)
: page_(page),
pending_login_query_(0) {
}
- // Send a query to the password store to populate an ExceptionsPageGtk.
+ // Send a query to the password store to populate an
+ // PasswordsExceptionsPageGtk.
void populate();
- // Send the password store's reply back to the ExceptionsPageGtk.
+ // Send the password store's reply back to the PasswordsExceptionsPageGtk.
virtual void OnPasswordStoreRequestDone(
int handle, const std::vector<webkit_glue::PasswordForm*>& result);
private:
- ExceptionsPageGtk* page_;
+ PasswordsExceptionsPageGtk* page_;
int pending_login_query_;
};
@@ -86,7 +91,7 @@
Profile* profile_;
std::vector<webkit_glue::PasswordForm> exception_list_;
- DISALLOW_COPY_AND_ASSIGN(ExceptionsPageGtk);
+ DISALLOW_COPY_AND_ASSIGN(PasswordsExceptionsPageGtk);
};
-#endif // CHROME_BROWSER_GTK_OPTIONS_EXCEPTIONS_PAGE_GTK_H_
+#endif // CHROME_BROWSER_GTK_OPTIONS_PASSWORDS_EXCEPTIONS_PAGE_GTK_H_
diff --git a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
index 4f5be8f..260a934 100644
--- a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
+++ b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -9,7 +9,7 @@
#include "app/l10n_util.h"
#include "base/message_loop.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/gtk/options/exceptions_page_gtk.h"
+#include "chrome/browser/gtk/options/passwords_exceptions_page_gtk.h"
#include "chrome/browser/gtk/options/passwords_page_gtk.h"
#include "chrome/browser/options_window.h"
#include "chrome/browser/profile.h"
@@ -47,7 +47,7 @@
PasswordsPageGtk passwords_page_;
// The exceptions page.
- ExceptionsPageGtk exceptions_page_;
+ PasswordsExceptionsPageGtk exceptions_page_;
DISALLOW_COPY_AND_ASSIGN(PasswordsExceptionsWindowGtk);
};
diff --git a/chrome/browser/sessions/session_service_test_helper.h b/chrome/browser/sessions/session_service_test_helper.h
index 869ca50a..8239884 100644
--- a/chrome/browser/sessions/session_service_test_helper.h
+++ b/chrome/browser/sessions/session_service_test_helper.h
@@ -1,10 +1,11 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
#ifndef CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_
#define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_TEST_HELPER_H_
+#include <string>
#include <vector>
#include "base/ref_counted.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 501e2ae..f9a7af1 100755
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1090,8 +1090,6 @@
'browser/gtk/options/cookie_filter_page_gtk.h',
'browser/gtk/options/cookies_view.cc',
'browser/gtk/options/cookies_view.h',
- 'browser/gtk/options/exceptions_page_gtk.cc',
- 'browser/gtk/options/exceptions_page_gtk.h',
'browser/gtk/options/fonts_languages_window_gtk.cc',
'browser/gtk/options/fonts_page_gtk.cc',
'browser/gtk/options/fonts_page_gtk.h',
@@ -1102,6 +1100,8 @@
'browser/gtk/options/options_layout_gtk.cc',
'browser/gtk/options/options_layout_gtk.h',
'browser/gtk/options/options_window_gtk.cc',
+ 'browser/gtk/options/passwords_exceptions_page_gtk.cc',
+ 'browser/gtk/options/passwords_exceptions_page_gtk.h',
'browser/gtk/options/passwords_exceptions_window_gtk.cc',
'browser/gtk/options/passwords_exceptions_window_gtk.h',
'browser/gtk/options/passwords_page_gtk.cc',