summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 17:41:16 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 17:41:16 +0000
commit8da1fa0d697791cbfc2415f6352be13b7c9c685b (patch)
tree6eb0de9df326f819570c2c94dfc9cb9e75daf0a4
parent6a939dc42610b8e79b45e9107a64c3aab916c85b (diff)
downloadchromium_src-8da1fa0d697791cbfc2415f6352be13b7c9c685b.zip
chromium_src-8da1fa0d697791cbfc2415f6352be13b7c9c685b.tar.gz
chromium_src-8da1fa0d697791cbfc2415f6352be13b7c9c685b.tar.bz2
Reverting r26698. Somehow this broke scons?
TBR=stuartmorgan Review URL: http://codereview.chromium.org/217004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26699 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider_mac.mm11
-rw-r--r--chrome/browser/browser.cc10
-rw-r--r--chrome/browser/browser_about_handler.cc23
-rw-r--r--chrome/browser/browser_init.cc24
-rw-r--r--chrome/browser/browser_resources.grd4
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h4
7 files changed, 80 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider_mac.mm b/chrome/browser/automation/automation_provider_mac.mm
index 6e8ae1b..17a4b3c 100644
--- a/chrome/browser/automation/automation_provider_mac.mm
+++ b/chrome/browser/automation/automation_provider_mac.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/gfx/point.h"
#include "base/gfx/rect.h"
+#include "chrome/test/automation/automation_messages.h"
void AutomationProvider::SetWindowBounds(int handle, const gfx::Rect& bounds,
bool* success) {
@@ -71,3 +72,13 @@ void AutomationProvider::GetBookmarkBarVisibility(int handle, bool* visible,
*animating = false;
NOTIMPLEMENTED();
}
+
+void AutomationProvider::WindowSimulateDrag(int handle,
+ std::vector<gfx::Point> drag_path,
+ int flags,
+ bool press_escape_en_route,
+ IPC::Message* reply_message) {
+ NOTIMPLEMENTED();
+ AutomationMsg_WindowDrag::WriteReplyParams(reply_message, false);
+ Send(reply_message);
+}
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 1a037c5..a8e5469 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -2264,7 +2264,17 @@ void Browser::InitCommandState() {
// Page-related commands
command_updater_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true);
+ // TODO(estade): remove these ifdefs when printing is fully supported.
+#if defined(OS_LINUX)
+#if defined(TOOLKIT_GTK)
+ command_updater_.UpdateCommandEnabled(IDC_PRINT,
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePrinting));
+#elif defined(TOOLKIT_VIEWS)
+ command_updater_.UpdateCommandEnabled(IDC_PRINT, false);
+#endif
+#else // !defined(OS_LINUX)
command_updater_.UpdateCommandEnabled(IDC_PRINT, true);
+#endif
command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true);
command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true);
command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true);
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 9331606..3e4baf3 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -75,6 +75,7 @@ const char kStatsPath[] = "stats";
const char kVersionPath[] = "version";
const char kCreditsPath[] = "credits";
const char kTermsPath[] = "terms";
+const char kLinuxSplash[] = "linux-splash";
const char kSyncPath[] = "sync";
// Points to the singleton AboutSource object, if any.
@@ -194,6 +195,23 @@ std::string AboutHistograms(const std::string& query) {
return data;
}
+std::string AboutLinuxSplash() {
+ int resource_id = IDR_LINUX_SPLASH_HTML_CHROMIUM;
+ scoped_ptr<FileVersionInfo> version_info(
+ FileVersionInfo::CreateFileVersionInfoForCurrentModule());
+ if (version_info == NULL) {
+ DLOG(ERROR) << "Unable to create FileVersionInfo object";
+ } else {
+ if (version_info->is_official_build()) {
+ resource_id = IDR_LINUX_SPLASH_HTML_CHROME;
+ }
+ }
+ static const std::string linux_splash_html =
+ ResourceBundle::GetSharedInstance().GetDataResource(resource_id);
+
+ return linux_splash_html;
+}
+
void AboutMemory(AboutSource* source, int request_id) {
// The AboutMemoryHandler cleans itself up.
new AboutMemoryHandler(source, request_id);
@@ -567,6 +585,11 @@ void AboutSource::StartDataRequest(const std::string& path_raw,
response = AboutSync();
#endif
}
+#if defined(OS_LINUX)
+ else if (path == kLinuxSplash) {
+ response = AboutLinuxSplash();
+ }
+#endif
FinishDataRequest(response, request_id);
}
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 26e6db5..1f0f5b1 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -443,6 +443,30 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile,
browser = BrowserList::GetLastActive();
OpenURLsInBrowser(browser, process_startup, urls_to_open);
}
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(TOOLKIT_VIEWS)
+ // TODO(port): Remove ifdef when the Linux splash page is not needed.
+ const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
+ // This can mess up UI tests, so only do it when UI tests aren't running.
+ if (!parsed_command_line.HasSwitch(switches::kHomePage) &&
+ GetURLsFromCommandLine(profile_).empty()) {
+ Browser* browser = BrowserList::GetLastActive();
+ if (browser) {
+ // Only show the splash page if it isn't already showing.
+ bool open_splash = true;
+ for (int i = 0; i < browser->tab_count(); ++i) {
+ if (browser->GetTabContentsAt(i)->GetURL().spec() ==
+ "about:linux-splash") {
+ open_splash = false;
+ }
+ }
+
+ if (open_splash) {
+ browser->OpenURL(GURL("about:linux-splash"), GURL(),
+ NEW_FOREGROUND_TAB, PageTransition::START_PAGE);
+ }
+ }
+ }
+#endif
// Check whether we are the default browser.
if (process_startup &&
!command_line_.HasSwitch(switches::kNoDefaultBrowserCheck))
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index fc6d70f..5e63902 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -45,6 +45,10 @@ without changes to the corresponding grd file. ek -->
<include name="IDR_PRINT_TAB_HTML" file="resources\print_tab.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_PRINT_TAB_CSS" file="resources\print_tab.css" type="BINDATA" />
<include name="IDR_PRINT_TAB_JS" file="resources\print_tab.js" type="BINDATA" />
+ <if expr="os == 'linux2'">
+ <include name="IDR_LINUX_SPLASH_HTML_CHROMIUM" file="resources\linux-splash.html" flattenhtml="true" type="BINDATA" />
+ <include name="IDR_LINUX_SPLASH_HTML_CHROME" file="resources\linux-splash-chrome.html" flattenhtml="true" type="BINDATA" />
+ </if>
<include name="IDR_ABOUT_SYNC_HTML" file="sync\resources\about_sync.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_GAIA_LOGIN_HTML" file="sync\resources\gaia_login.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SYNC_SETUP_FLOW_HTML" file="sync\resources\setup_flow.html" flattenhtml="true" type="BINDATA" />
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 075a350..e320f82 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -603,4 +603,8 @@ const wchar_t kExplicitlyAllowedPorts[] = L"explicitly-allowed-ports";
// is launched on the command line (e.g. by Selenium). Only needed on Mac.
const wchar_t kActivateOnLaunch[] = L"activate-on-launch";
+#if defined(OS_LINUX)
+const wchar_t kEnablePrinting[] = L"enable-printing";
+#endif
+
} // namespace switches
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index f031399..1d25d7c 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -245,6 +245,10 @@ extern const wchar_t kExplicitlyAllowedPorts[];
extern const wchar_t kActivateOnLaunch[];
+#if defined(OS_LINUX)
+extern const wchar_t kEnablePrinting[];
+#endif
+
} // namespace switches
#endif // CHROME_COMMON_CHROME_SWITCHES_H_