summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 19:29:47 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-27 19:29:47 +0000
commitf039dcd91912b8bf68ec73d744ad38ff4b4d1398 (patch)
treeac742b926916f8c463d56ba986452b74665c76c0
parentf7319dd6e64e34e091de48d210fb6870a6cfd586 (diff)
downloadchromium_src-f039dcd91912b8bf68ec73d744ad38ff4b4d1398.zip
chromium_src-f039dcd91912b8bf68ec73d744ad38ff4b4d1398.tar.gz
chromium_src-f039dcd91912b8bf68ec73d744ad38ff4b4d1398.tar.bz2
Adds the settings tab to options on chrome os. The contents is just a place
holder at this point. BUG=none TEST=none Review URL: http://codereview.chromium.org/174596 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24642 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd7
-rw-r--r--chrome/browser/chromeos/settings_page_view.cc35
-rw-r--r--chrome/browser/chromeos/settings_page_view.h29
-rw-r--r--chrome/browser/gtk/options/options_window_gtk.cc12
-rw-r--r--chrome/browser/options_window.h3
-rw-r--r--chrome/chrome.gyp9
6 files changed, 95 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index fe1ccc1..3956679 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -4860,6 +4860,13 @@ each locale. -->
<message translateable="false" name="IDS_GLEN" desc="Glen">
Glen
</message>
+
+ <if expr="pp_ifdef('chromeos')">
+ <message name="IDS_OPTIONS_SETTINGS_TAB_LABEL" desc="Title of the settings tab inthe options dialog.">
+ Chrome OS
+ </message>
+ </if>
+
</messages>
</release>
</grit>
diff --git a/chrome/browser/chromeos/settings_page_view.cc b/chrome/browser/chromeos/settings_page_view.cc
new file mode 100644
index 0000000..bfbb46f
--- /dev/null
+++ b/chrome/browser/chromeos/settings_page_view.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2009 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/chromeos/settings_page_view.h"
+
+#include "views/controls/label.h"
+#include "views/fill_layout.h"
+#include "views/widget/widget_gtk.h"
+
+SettingsPageView::SettingsPageView(Profile* profile)
+ : OptionsPageView(profile) {
+ SetLayoutManager(new views::FillLayout());
+}
+
+GtkWidget* SettingsPageView::WrapInGtkWidget() {
+ views::WidgetGtk* widget =
+ new views::WidgetGtk(views::WidgetGtk::TYPE_CHILD);
+ widget->Init(NULL, gfx::Rect());
+ widget->SetContentsView(this);
+ widget->Show();
+ // Removing the widget from the container results in unref'ing the widget. We
+ // need to ref here otherwise the removal deletes the widget. The caller ends
+ // up taking ownership.
+ g_object_ref(widget->GetNativeView());
+ GtkWidget* parent = gtk_widget_get_parent(widget->GetNativeView());
+ gtk_container_remove(GTK_CONTAINER(parent), widget->GetNativeView());
+ return widget->GetNativeView();
+}
+
+void SettingsPageView::InitControlLayout() {
+ // Remove this and add the real views we want. We'll likely need to make this
+ // scrollable as well.
+ AddChildView(new views::Label(L"Implement me"));
+}
diff --git a/chrome/browser/chromeos/settings_page_view.h b/chrome/browser/chromeos/settings_page_view.h
new file mode 100644
index 0000000..b512fea
--- /dev/null
+++ b/chrome/browser/chromeos/settings_page_view.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2009 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_CHROMEOS_SETTINGS_PAGE_VIEW_H_
+#define CHROME_BROWSER_CHROMEOS_SETTINGS_PAGE_VIEW_H_
+
+#include "chrome/browser/views/options/options_page_view.h"
+
+#include <gtk/gtk.h>
+
+// Settings page for Chrome OS.
+class SettingsPageView : public OptionsPageView {
+ public:
+ explicit SettingsPageView(Profile* profile);
+
+ // Wraps the SettingsPageView in a GtkWidget and returns it. It's up to the
+ // caller to delete (unref) the returned widget, which in turn deletes this
+ // SettingsPageView.
+ GtkWidget* WrapInGtkWidget();
+
+ protected:
+ virtual void InitControlLayout();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SettingsPageView);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_PAGE_VIEW_H_
diff --git a/chrome/browser/gtk/options/options_window_gtk.cc b/chrome/browser/gtk/options/options_window_gtk.cc
index 2f5c750..63f3306 100644
--- a/chrome/browser/gtk/options/options_window_gtk.cc
+++ b/chrome/browser/gtk/options/options_window_gtk.cc
@@ -20,6 +20,10 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/settings_page_view.h"
+#endif
+
///////////////////////////////////////////////////////////////////////////////
// OptionsWindowGtk
//
@@ -100,6 +104,14 @@ OptionsWindowGtk::OptionsWindowGtk(Profile* profile)
notebook_ = gtk_notebook_new();
+#if defined(OS_CHROMEOS)
+ gtk_notebook_append_page(
+ GTK_NOTEBOOK(notebook_),
+ (new SettingsPageView(profile_))->WrapInGtkWidget(),
+ gtk_label_new(
+ l10n_util::GetStringUTF8(IDS_OPTIONS_SETTINGS_TAB_LABEL).c_str()));
+#endif
+
gtk_notebook_append_page(
GTK_NOTEBOOK(notebook_),
general_page_.get_page_widget(),
diff --git a/chrome/browser/options_window.h b/chrome/browser/options_window.h
index ad119f9..a55359d 100644
--- a/chrome/browser/options_window.h
+++ b/chrome/browser/options_window.h
@@ -13,6 +13,9 @@ class Profile;
// Options was never opened.
enum OptionsPage {
OPTIONS_PAGE_DEFAULT = -1,
+#if defined(OS_CHROMEOS)
+ OPTIONS_PAGE_SETTINGS,
+#endif
OPTIONS_PAGE_GENERAL,
OPTIONS_PAGE_CONTENT,
OPTIONS_PAGE_ADVANCED,
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 564eba3..1774c23 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -253,6 +253,11 @@
'action': ['python', '<@(_inputs)', '-i', '<(RULE_INPUT_PATH)',
'build', '-o', '<(grit_out_dir)',
'-D', '<(chrome_build)'],
+ 'conditions': [
+ ['chromeos==1', {
+ 'action': ['-D', 'chromeos'],
+ }],
+ ],
'message': 'Generating resources from <(RULE_INPUT_PATH)',
},
],
@@ -806,6 +811,8 @@
'browser/chromeos/pipe_reader.h',
'browser/chromeos/external_cookie_handler.cc',
'browser/chromeos/external_cookie_handler.h',
+ 'browser/chromeos/settings_page_view.cc',
+ 'browser/chromeos/settings_page_view.h',
'browser/cocoa/about_window_controller.h',
'browser/cocoa/about_window_controller.mm',
'browser/cocoa/autocomplete_text_field.h',
@@ -2518,6 +2525,8 @@
['include', 'browser/views/frame/status_area_view.h'],
['include', 'browser/views/new_browser_window_widget.cc'],
['include', 'browser/views/new_browser_window_widget.h'],
+ ['include', 'browser/views/options/options_page_view.cc'],
+ ['include', 'browser/views/options/options_page_view.h'],
['include', 'browser/views/panel_controller.cc'],
['include', 'browser/views/panel_controller.h'],
['include', 'browser/views/panels/panel_container.cc'],