OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/shell.h" | 5 #include "content/shell/shell.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/string_piece.h" | 12 #include "base/string_piece.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
15 #include "content/public/browser/native_web_keyboard_event.h" | 15 #include "content/public/browser/native_web_keyboard_event.h" |
16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
17 #include "content/public/browser/web_contents_view.h" | 17 #include "content/public/browser/web_contents_view.h" |
18 #include "content/public/common/renderer_preferences.h" | 18 #include "content/public/common/renderer_preferences.h" |
19 #include "content/shell/shell_switches.h" | 19 #include "content/shell/shell_switches.h" |
20 #include "grit/net_resources.h" | |
20 #include "third_party/skia/include/core/SkColor.h" | 21 #include "third_party/skia/include/core/SkColor.h" |
22 #include "ui/base/resource/resource_bundle.h" | |
21 | 23 |
22 namespace content { | 24 namespace content { |
23 | 25 |
24 void Shell::PlatformInitialize() { | 26 void Shell::PlatformInitialize() { |
25 } | 27 } |
26 | 28 |
27 base::StringPiece Shell::PlatformResourceProvider(int key) { | 29 base::StringPiece Shell::PlatformResourceProvider(int key) { |
28 NOTIMPLEMENTED(); | 30 if (IDR_DIR_HEADER_HTML == key) { |
31 base::StringPiece html_data = | |
32 ui::ResourceBundle::GetSharedInstance().GetRawDataResource( | |
33 IDR_DIR_HEADER_HTML, ui::SCALE_FACTOR_NONE); | |
jam
2012/08/10 15:06:15
this code looks like it's cross platform (i.e. we
jam
2012/08/10 15:10:10
nvm, juts saw that Windows is the only one that ha
jam
2012/08/10 15:42:05
just tried this on Windows, and it worked. here's
| |
34 return html_data; | |
35 } | |
29 return base::StringPiece(); | 36 return base::StringPiece(); |
30 } | 37 } |
31 | 38 |
32 void Shell::PlatformCleanUp() { | 39 void Shell::PlatformCleanUp() { |
33 // Nothing to clean up; GTK will clean up the widgets shortly after. | 40 // Nothing to clean up; GTK will clean up the widgets shortly after. |
34 } | 41 } |
35 | 42 |
36 void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { | 43 void Shell::PlatformEnableUIControl(UIControl control, bool is_enabled) { |
37 GtkToolItem* item = NULL; | 44 GtkToolItem* item = NULL; |
38 switch (control) { | 45 switch (control) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 gtk_widget_grab_focus(GTK_WIDGET(url_edit_view_)); | 238 gtk_widget_grab_focus(GTK_WIDGET(url_edit_view_)); |
232 return TRUE; | 239 return TRUE; |
233 } | 240 } |
234 | 241 |
235 void Shell::PlatformSetTitle(const string16& title) { | 242 void Shell::PlatformSetTitle(const string16& title) { |
236 std::string title_utf8 = UTF16ToUTF8(title); | 243 std::string title_utf8 = UTF16ToUTF8(title); |
237 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); | 244 gtk_window_set_title(GTK_WINDOW(window_), title_utf8.c_str()); |
238 } | 245 } |
239 | 246 |
240 } // namespace content | 247 } // namespace content |
OLD | NEW |