diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 07:05:52 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 07:05:52 +0000 |
commit | c4f8fdcd67231e7786b690be805d9f036ed0f324 (patch) | |
tree | ded960ca991beaff02d51038bc00738d0682f99b /chrome | |
parent | 109763bb929004fefa409c342d1c14a78bfe126f (diff) | |
download | chromium_src-c4f8fdcd67231e7786b690be805d9f036ed0f324.zip chromium_src-c4f8fdcd67231e7786b690be805d9f036ed0f324.tar.gz chromium_src-c4f8fdcd67231e7786b690be805d9f036ed0f324.tar.bz2 |
Reverted 29255.
TBR: nick@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
17 files changed, 62 insertions, 84 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/engine/syncer.cc b/chrome/browser/sync/engine/syncer.cc index de8b1b2..9274edf 100644 --- a/chrome/browser/sync/engine/syncer.cc +++ b/chrome/browser/sync/engine/syncer.cc @@ -118,7 +118,7 @@ void Syncer::SyncShare(SyncerSession* session, // Reset silenced_until_, it is the callers responsibility to honor throttles. silenced_until_ = session->silenced_until(); - SyncerStep next_step = current_step; + SyncerStep next_step; while (!ExitRequested()) { switch (current_step) { case SYNCER_BEGIN: diff --git a/chrome/browser/sync/engine/syncer_thread.cc b/chrome/browser/sync/engine/syncer_thread.cc index 0861940..073b5ea 100644 --- a/chrome/browser/sync/engine/syncer_thread.cc +++ b/chrome/browser/sync/engine/syncer_thread.cc @@ -75,7 +75,7 @@ int UserIdleTime() { } int64 idle_time; // in nanoseconds - Boolean success = false; + Boolean success; if (CFGetTypeID(object) == CFNumberGetTypeID()) { success = CFNumberGetValue((CFNumberRef)object, kCFNumberSInt64Type, 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" diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 8c47be4..1222730 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -155,7 +155,7 @@ }], # branding ], # conditions }], # OS=="mac" - ['OS=="win" or OS=="mac"', { + ['OS=="win"', { # Whether or not browser sync code is built in. 'chrome_personalization%': 1, }, { @@ -205,7 +205,7 @@ ['OS=="linux" and toolkit_views==1', {'sources/': [ ['include', '_views\\.cc$'], ]}], - ['(OS=="win" or OS=="mac") and chrome_personalization==1', { + ['OS=="win" and chrome_personalization==1', { 'defines': ['CHROME_PERSONALIZATION=1'], }], # chrome_personalization==1 ], @@ -2045,10 +2045,6 @@ 'browser/sync/glue/sync_backend_host.h', 'browser/sync/profile_sync_service.cc', 'browser/sync/profile_sync_service.h', - 'browser/sync/sync_setup_flow.cc', - 'browser/sync/sync_setup_flow.h', - 'browser/sync/sync_setup_wizard.cc', - 'browser/sync/sync_setup_wizard.h', 'browser/sync/sync_status_ui_helper.cc', 'browser/sync/sync_status_ui_helper.h', 'browser/tab_contents/constrained_window.h', @@ -2298,6 +2294,10 @@ 'browser/views/star_toggle.h', 'browser/views/status_bubble_views.cc', 'browser/views/status_bubble_views.h', + 'browser/views/sync/sync_setup_flow.cc', + 'browser/views/sync/sync_setup_flow.h', + 'browser/views/sync/sync_setup_wizard.cc', + 'browser/views/sync/sync_setup_wizard.h', 'browser/views/tab_icon_view.cc', 'browser/views/tab_icon_view.h', 'browser/views/tab_contents/tab_contents_container.cc', @@ -3922,7 +3922,6 @@ 'test/perf/mem_usage_mac.cc', 'test/perf/mem_usage_win.cc', 'test/perf/mem_usage.h', - 'test/test_browser_window.h', 'test/testing_profile.cc', 'test/testing_profile.h', 'test/ui_test_utils.cc', @@ -4553,7 +4552,6 @@ 'browser/sync/glue/bookmark_model_worker_unittest.cc', 'browser/sync/glue/http_bridge_unittest.cc', 'browser/sync/profile_sync_service_unittest.cc', - 'browser/sync/sync_setup_wizard_unittest.cc', 'browser/tab_contents/navigation_controller_unittest.cc', 'browser/tab_contents/navigation_entry_unittest.cc', 'browser/tab_contents/render_view_host_manager_unittest.cc', @@ -4565,6 +4563,7 @@ 'browser/utility_process_host_unittest.cc', 'browser/views/bookmark_context_menu_test.cc', 'browser/views/bookmark_editor_view_unittest.cc', + 'browser/views/sync/sync_setup_wizard_unittest.cc', 'browser/visitedlink_unittest.cc', 'browser/webdata/web_database_unittest.cc', 'browser/window_sizer_unittest.cc', @@ -4635,8 +4634,6 @@ 'browser/renderer_host/gtk_key_bindings_handler_unittest.cc', ], 'sources!': [ - # TODO(akalin): Figure out why this unittest fails on linux. - 'browser/browser_commands_unittest.cc', 'browser/views/bookmark_context_menu_test.cc', 'browser/gtk/options/cookies_view_unittest.cc', # Compact Language Detection (cld) is not supported in linux yet. @@ -4759,6 +4756,8 @@ 'browser/bookmarks/bookmark_drag_data_unittest.cc', 'browser/bookmarks/bookmark_folder_tree_model_unittest.cc', 'browser/bookmarks/bookmark_table_model_unittest.cc', + # Need to port browser_with_test_window_test.* first + 'browser/browser_commands_unittest.cc', 'browser/browser_unittest.cc', 'browser/extensions/extension_process_manager_unittest.cc', 'browser/importer/importer_unittest.cc', @@ -4770,8 +4769,11 @@ 'browser/views/bookmark_editor_view_unittest.cc', 'browser/views/find_bar_host_unittest.cc', 'browser/views/keyword_editor_view_unittest.cc', + 'browser/views/sync/sync_setup_wizard_unittest.cc', 'common/chrome_plugin_unittest.cc', 'common/net/url_util_unittest.cc', + 'test/browser_with_test_window_test.cc', + 'test/browser_with_test_window_test.h', ], }], ['chrome_personalization==1', { @@ -6709,10 +6711,6 @@ '-lsecur32.lib', ], }, - }, { # else: OS != "win" - 'sources!': [ - 'browser/sync/util/data_encryption_unittest.cc', - ], }], ['OS=="linux"', { 'defines': [ diff --git a/chrome/test/browser_with_test_window_test.cc b/chrome/test/browser_with_test_window_test.cc index 8dede7c..3e3fb93 100644 --- a/chrome/test/browser_with_test_window_test.cc +++ b/chrome/test/browser_with_test_window_test.cc @@ -12,9 +12,7 @@ BrowserWithTestWindowTest::BrowserWithTestWindowTest() : rph_factory_(), rvh_factory_(&rph_factory_) { -#if defined(OS_WIN) OleInitialize(NULL); -#endif } void BrowserWithTestWindowTest::SetUp() { @@ -40,9 +38,7 @@ BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); MessageLoop::current()->Run(); -#if defined(OS_WIN) OleUninitialize(); -#endif } TestRenderViewHost* BrowserWithTestWindowTest::TestRenderViewHostForTab( diff --git a/chrome/test/sync/engine/mock_server_connection.cc b/chrome/test/sync/engine/mock_server_connection.cc index b2af891..372d408 100644 --- a/chrome/test/sync/engine/mock_server_connection.cc +++ b/chrome/test/sync/engine/mock_server_connection.cc @@ -43,9 +43,9 @@ MockConnectionManager::MockConnectionManager(DirectoryManager* dirmgr, directory_name_(name), mid_commit_callback_function_(NULL), mid_commit_observer_(NULL), + client_command_(NULL), throttling_(false), fail_non_periodic_get_updates_(false), - client_command_(NULL), next_position_in_parent_(2) { server_reachable_ = true; }; @@ -405,5 +405,4 @@ void MockConnectionManager::ThrottleNextRequest( throttling_ = true; if (visitor) visitor->VisitAtomically(); -} - +}
\ No newline at end of file diff --git a/chrome/test/sync/engine/test_directory_setter_upper.cc b/chrome/test/sync/engine/test_directory_setter_upper.cc index 9e910f0..2685795 100644 --- a/chrome/test/sync/engine/test_directory_setter_upper.cc +++ b/chrome/test/sync/engine/test_directory_setter_upper.cc @@ -85,6 +85,12 @@ void ManuallyOpenedTestDirectorySetterUpper::TearDown() { TestDirectorySetterUpper::TearDown(); } } + +static PathString UTF8ToPathStringQuick(const std::string &str) { + PathString ret; + CHECK(browser_sync::UTF8ToPathString(str.data(), str.size(), &ret)); + return ret; +} TriggeredOpenTestDirectorySetterUpper::TriggeredOpenTestDirectorySetterUpper( const std::string& name) diff --git a/chrome/test/test_browser_window.h b/chrome/test/test_browser_window.h index d785415..8aa657d 100644 --- a/chrome/test/test_browser_window.h +++ b/chrome/test/test_browser_window.h @@ -7,14 +7,18 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" +#include "chrome/browser/views/tabs/tab_strip.h" #include "chrome/test/test_location_bar.h" // An implementation of BrowserWindow used for testing. TestBrowserWindow only -// contains a valid LocationBar, all other getters return NULL. +// contains a valid TabStrip, all other getters return NULL. // See BrowserWithTestWindowTest for an example of using this class. class TestBrowserWindow : public BrowserWindow { public: - explicit TestBrowserWindow(Browser* browser) {} + explicit TestBrowserWindow(Browser* browser) + : tab_strip_(browser->tabstrip_model()) { + tab_strip_.InitTabStripButtons(); + } virtual ~TestBrowserWindow() {} virtual void Init() {} @@ -87,6 +91,8 @@ class TestBrowserWindow : public BrowserWindow { virtual void DestroyBrowser() {} private: + TabStrip tab_strip_; + TestLocationBar location_bar_; DISALLOW_COPY_AND_ASSIGN(TestBrowserWindow); |