summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 02:43:28 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-16 02:43:28 +0000
commit38dc6d7d2e7f36490dbe6aed60cccfc76b11af45 (patch)
tree45b735c54b023e85b119a39b6425966a4c57c884 /chrome/browser
parenta78410304ccc90a44852c9714317787c63bb50a3 (diff)
downloadchromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.zip
chromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.tar.gz
chromium_src-38dc6d7d2e7f36490dbe6aed60cccfc76b11af45.tar.bz2
TBR: nick@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_window.h2
-rw-r--r--chrome/browser/sync/profile_sync_service.h2
-rw-r--r--chrome/browser/sync/util/character_set_converters.h15
-rw-r--r--chrome/browser/sync/util/user_settings_unittest.cc12
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_mac.mm12
-rw-r--r--chrome/browser/views/sync/sync_setup_flow.cc (renamed from chrome/browser/sync/sync_setup_flow.cc)13
-rw-r--r--chrome/browser/views/sync/sync_setup_flow.h (renamed from chrome/browser/sync/sync_setup_flow.h)8
-rw-r--r--chrome/browser/views/sync/sync_setup_wizard.cc (renamed from chrome/browser/sync/sync_setup_wizard.cc)4
-rw-r--r--chrome/browser/views/sync/sync_setup_wizard.h (renamed from chrome/browser/sync/sync_setup_wizard.h)19
-rw-r--r--chrome/browser/views/sync/sync_setup_wizard_unittest.cc (renamed from chrome/browser/sync/sync_setup_wizard_unittest.cc)4
10 files changed, 32 insertions, 59 deletions
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h
index f417166..a83fbbd 100644
--- a/chrome/browser/browser_window.h
+++ b/chrome/browser/browser_window.h
@@ -31,7 +31,7 @@ class Rect;
// BrowserWindow interface
// An interface implemented by the "view" of the Browser window.
//
-// NOTE: All getters may return NULL.
+// NOTE: All getters except GetTabStrip() may return NULL.
class BrowserWindow {
public:
// Show the window, or activates it if it's already visible.
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 9eedbef..fab7ea5 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -20,7 +20,7 @@
#include "chrome/browser/sync/glue/change_processor.h"
#include "chrome/browser/sync/glue/model_associator.h"
#include "chrome/browser/sync/glue/sync_backend_host.h"
-#include "chrome/browser/sync/sync_setup_wizard.h"
+#include "chrome/browser/views/sync/sync_setup_wizard.h"
#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/sync/util/character_set_converters.h b/chrome/browser/sync/util/character_set_converters.h
index 6a833ee..1db32c7 100644
--- a/chrome/browser/sync/util/character_set_converters.h
+++ b/chrome/browser/sync/util/character_set_converters.h
@@ -136,21 +136,6 @@ inline void AppendPathStringToUTF8(const PathString& wide,
return AppendPathStringToUTF8(wide.data(), wide.length(), output_string);
}
-// Versions of UTF8ToPathString/PathStringToUTF8 that return the converted
-// string directly. Any errors encountered will CHECK(). These functions are
-// intended to be used only for testing.
-
-inline PathString UTF8ToPathStringQuick(const std::string &utf8) {
- PathString wide;
- CHECK(UTF8ToPathString(utf8.data(), utf8.size(), &wide));
- return wide;
-}
-
-inline std::string PathStringToUTF8Quick(const PathString& wide) {
- std::string utf8;
- PathStringToUTF8(wide.data(), wide.size(), &utf8);
- return utf8;
-}
inline bool Append(const PathChar* wide, int size,
std::string* output_string) {
diff --git a/chrome/browser/sync/util/user_settings_unittest.cc b/chrome/browser/sync/util/user_settings_unittest.cc
index 02f3fd8..952c86b 100644
--- a/chrome/browser/sync/util/user_settings_unittest.cc
+++ b/chrome/browser/sync/util/user_settings_unittest.cc
@@ -2,12 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE entry.
-#include <string>
-
#include "base/file_util.h"
#include "base/test/test_file_util.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
-#include "chrome/browser/sync/util/character_set_converters.h"
#include "chrome/browser/sync/util/user_settings.h"
#include "chrome/browser/sync/util/query_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -43,10 +40,15 @@ class UserSettingsTest : public testing::Test {
ExecOrDie(primer_handle, "CREATE TABLE shares"
" (email, share_name, file_name,"
" PRIMARY KEY(email, share_name) ON CONFLICT REPLACE)");
+#if OS_WIN
+ // Populate a share.
+ ExecOrDie(primer_handle, "INSERT INTO shares values ( ?, ?, ?)",
+ "foo@foo.com", "foo@foo.com", WideToUTF8(kOldStyleSyncDataDB));
+#elif OS_LINUX
// Populate a share.
ExecOrDie(primer_handle, "INSERT INTO shares values ( ?, ?, ?)",
- "foo@foo.com", "foo@foo.com",
- browser_sync::PathStringToUTF8Quick(kOldStyleSyncDataDB));
+ "foo@foo.com", "foo@foo.com", kOldStyleSyncDataDB);
+#endif
sqlite3_close(primer_handle);
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm
index c966ee8..21b4970 100644
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -16,7 +16,6 @@
#include "chrome/browser/cocoa/sad_tab_view.h"
#import "chrome/browser/cocoa/web_drag_source.h"
#import "chrome/browser/cocoa/web_drop_target.h"
-#include "chrome/browser/renderer_host/render_view_host_factory.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
#include "chrome/browser/tab_contents/render_view_context_menu_mac.h"
@@ -72,16 +71,7 @@ void TabContentsViewMac::CreateView(const gfx::Size& initial_size) {
RenderWidgetHostView* TabContentsViewMac::CreateViewForWidget(
RenderWidgetHost* render_widget_host) {
- if (render_widget_host->view()) {
- // During testing, the view will already be set up in most cases to the
- // test view, so we don't want to clobber it with a real one. To verify that
- // this actually is happening (and somebody isn't accidentally creating the
- // view twice), we check for the RVH Factory, which will be set when we're
- // making special ones (which go along with the special views).
- DCHECK(RenderViewHostFactory::has_factory());
- return render_widget_host->view();
- }
-
+ DCHECK(!render_widget_host->view());
RenderWidgetHostViewMac* view =
new RenderWidgetHostViewMac(render_widget_host);
diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/views/sync/sync_setup_flow.cc
index 2784572..01a5728 100644
--- a/chrome/browser/sync/sync_setup_flow.cc
+++ b/chrome/browser/views/sync/sync_setup_flow.cc
@@ -4,15 +4,13 @@
#ifdef CHROME_PERSONALIZATION
-#include "chrome/browser/sync/sync_setup_flow.h"
+#include "chrome/browser/views/sync/sync_setup_flow.h"
#include "app/gfx/font.h"
-#include "app/gfx/font_util.h"
#include "base/histogram.h"
#include "base/json_reader.h"
#include "base/json_writer.h"
#include "base/string_util.h"
-#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
@@ -22,6 +20,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/pref_names.h"
#include "grit/locale_settings.h"
+#include "views/window/window.h"
// XPath expression for finding specific iframes.
static const wchar_t* kLoginIFrameXPath = L"//iframe[@id='login']";
@@ -157,7 +156,7 @@ void SyncSetupFlow::GetDialogSize(gfx::Size* size) const {
prefs->GetString(prefs::kWebKitSansSerifFontFamily),
prefs->GetInteger(prefs::kWebKitDefaultFontSize));
- gfx::Size s = gfx::GetLocalizedContentsSizeForFont(
+ gfx::Size s = views::Window::GetLocalizedContentsSizeForFont(
IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS,
IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES,
approximate_web_font);
@@ -265,12 +264,10 @@ void SyncSetupFlow::Advance(SyncSetupWizard::State advance_state) {
flow_handler_->ShowMergeAndSyncError();
break;
case SyncSetupWizard::DONE_FIRST_TIME:
- flow_handler_->ShowFirstTimeDone(
- UTF16ToWide(service_->GetAuthenticatedUsername()));
+ flow_handler_->ShowFirstTimeDone(service_->GetAuthenticatedUsername());
break;
case SyncSetupWizard::DONE:
- flow_handler_->ShowSetupDone(
- UTF16ToWide(service_->GetAuthenticatedUsername()));
+ flow_handler_->ShowSetupDone(service_->GetAuthenticatedUsername());
break;
default:
NOTREACHED() << "Invalid advance state: " << advance_state;
diff --git a/chrome/browser/sync/sync_setup_flow.h b/chrome/browser/views/sync/sync_setup_flow.h
index 32e3db1..4bc7d60 100644
--- a/chrome/browser/sync/sync_setup_flow.h
+++ b/chrome/browser/views/sync/sync_setup_flow.h
@@ -4,8 +4,8 @@
#ifdef CHROME_PERSONALIZATION
-#ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_
-#define CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_
+#ifndef CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_FLOW_H_
+#define CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_FLOW_H_
#include <string>
#include <vector>
@@ -14,7 +14,7 @@
#include "base/time.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/sync_setup_wizard.h"
+#include "chrome/browser/views/sync/sync_setup_wizard.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
@@ -185,5 +185,5 @@ class FlowHandler : public DOMMessageHandler {
DISALLOW_COPY_AND_ASSIGN(FlowHandler);
};
-#endif // CHROME_BROWSER_SYNC_SYNC_SETUP_FLOW_H_
+#endif // CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_FLOW_H_
#endif // CHROME_PERSONALIZATION
diff --git a/chrome/browser/sync/sync_setup_wizard.cc b/chrome/browser/views/sync/sync_setup_wizard.cc
index 7d00ab9..31afcea 100644
--- a/chrome/browser/sync/sync_setup_wizard.cc
+++ b/chrome/browser/views/sync/sync_setup_wizard.cc
@@ -4,7 +4,7 @@
#ifdef CHROME_PERSONALIZATION
-#include "chrome/browser/sync/sync_setup_wizard.h"
+#include "chrome/browser/views/sync/sync_setup_wizard.h"
#include "app/resource_bundle.h"
#include "base/message_loop.h"
@@ -13,7 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/sync_setup_flow.h"
+#include "chrome/browser/views/sync/sync_setup_flow.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/url_constants.h"
#include "grit/app_resources.h"
diff --git a/chrome/browser/sync/sync_setup_wizard.h b/chrome/browser/views/sync/sync_setup_wizard.h
index d8a0d95..1d36f61 100644
--- a/chrome/browser/sync/sync_setup_wizard.h
+++ b/chrome/browser/views/sync/sync_setup_wizard.h
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_
-#define CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_
+#ifndef CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_WIZARD_H_
+#define CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_WIZARD_H_
#include "base/basictypes.h"
-#if defined(OS_LINUX)
+#if defined(OS_WIN)
+class SyncSetupFlowContainer;
+#elif defined(OS_LINUX)
typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;
-#else
-class SyncSetupFlowContainer;
#endif
class ProfileSyncService;
@@ -69,14 +69,13 @@ class SyncSetupWizard {
ProfileSyncService* service_;
-#if defined(OS_LINUX)
- bool visible_;
-#else
+#if defined(OS_WIN)
SyncSetupFlowContainer* flow_container_;
+#elif defined(OS_LINUX)
+ bool visible_;
#endif
DISALLOW_COPY_AND_ASSIGN(SyncSetupWizard);
};
-#endif // CHROME_BROWSER_SYNC_SYNC_SETUP_WIZARD_H_
-
+#endif // CHROME_BROWSER_VIEWS_SYNC_SYNC_SETUP_WIZARD_H_
diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/views/sync/sync_setup_wizard_unittest.cc
index 3a04746..fec7ef3 100644
--- a/chrome/browser/sync/sync_setup_wizard_unittest.cc
+++ b/chrome/browser/views/sync/sync_setup_wizard_unittest.cc
@@ -11,8 +11,8 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/sync_setup_flow.h"
-#include "chrome/browser/sync/sync_setup_wizard.h"
+#include "chrome/browser/views/sync/sync_setup_flow.h"
+#include "chrome/browser/views/sync/sync_setup_wizard.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/test/browser_with_test_window_test.h"