| 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 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/prefs/public/pref_member.h" | 13 #include "base/prefs/public/pref_member.h" |
| 14 #include "chrome/browser/command_observer.h" | 14 #include "chrome/browser/command_observer.h" |
| 15 #include "chrome/browser/ui/gtk/custom_button.h" | 15 #include "chrome/browser/ui/gtk/custom_button.h" |
| 16 #include "chrome/browser/ui/gtk/menu_gtk.h" | 16 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 17 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 17 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
| 18 #include "content/public/browser/host_zoom_map.h" |
| 18 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 20 #include "ui/base/accelerators/accelerator.h" | 21 #include "ui/base/accelerators/accelerator.h" |
| 21 #include "ui/base/gtk/gtk_signal.h" | 22 #include "ui/base/gtk/gtk_signal.h" |
| 22 #include "ui/base/gtk/gtk_signal_registrar.h" | 23 #include "ui/base/gtk/gtk_signal_registrar.h" |
| 23 #include "ui/base/gtk/owned_widget_gtk.h" | 24 #include "ui/base/gtk/owned_widget_gtk.h" |
| 24 #include "ui/base/models/simple_menu_model.h" | 25 #include "ui/base/models/simple_menu_model.h" |
| 25 | 26 |
| 26 class BackForwardButtonGtk; | 27 class BackForwardButtonGtk; |
| 27 class Browser; | 28 class Browser; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const content::NotificationDetails& details) OVERRIDE; | 106 const content::NotificationDetails& details) OVERRIDE; |
| 106 | 107 |
| 107 // Whether the wrench/hotdogs menu is currently visible to the user. | 108 // Whether the wrench/hotdogs menu is currently visible to the user. |
| 108 bool IsWrenchMenuShowing() const; | 109 bool IsWrenchMenuShowing() const; |
| 109 | 110 |
| 110 // Message that we should react to a state change. | 111 // Message that we should react to a state change. |
| 111 void UpdateWebContents(content::WebContents* contents, | 112 void UpdateWebContents(content::WebContents* contents, |
| 112 bool should_restore_state); | 113 bool should_restore_state); |
| 113 | 114 |
| 114 private: | 115 private: |
| 116 void OnZoomLevelChanged(const std::string& host); |
| 117 |
| 115 // Connect/Disconnect signals for dragging a url onto the home button. | 118 // Connect/Disconnect signals for dragging a url onto the home button. |
| 116 void SetUpDragForHomeButton(); | 119 void SetUpDragForHomeButton(); |
| 117 | 120 |
| 118 // Sets the top corners of the toolbar to rounded, or sets them to normal, | 121 // Sets the top corners of the toolbar to rounded, or sets them to normal, |
| 119 // depending on the state of the browser window. Returns false if no action | 122 // depending on the state of the browser window. Returns false if no action |
| 120 // was taken (the roundedness was already correct), true otherwise. | 123 // was taken (the roundedness was already correct), true otherwise. |
| 121 bool UpdateRoundedness(); | 124 bool UpdateRoundedness(); |
| 122 | 125 |
| 123 // Gtk callback for the "expose-event" signal. | 126 // Gtk callback for the "expose-event" signal. |
| 124 // The alignment contains the toolbar. | 127 // The alignment contains the toolbar. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 Browser* browser_; | 207 Browser* browser_; |
| 205 BrowserWindowGtk* window_; | 208 BrowserWindowGtk* window_; |
| 206 | 209 |
| 207 // Controls whether or not a home button should be shown on the toolbar. | 210 // Controls whether or not a home button should be shown on the toolbar. |
| 208 BooleanPrefMember show_home_button_; | 211 BooleanPrefMember show_home_button_; |
| 209 | 212 |
| 210 // Preferences controlling the configured home page. | 213 // Preferences controlling the configured home page. |
| 211 StringPrefMember home_page_; | 214 StringPrefMember home_page_; |
| 212 BooleanPrefMember home_page_is_new_tab_page_; | 215 BooleanPrefMember home_page_is_new_tab_page_; |
| 213 | 216 |
| 217 content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_; |
| 214 content::NotificationRegistrar registrar_; | 218 content::NotificationRegistrar registrar_; |
| 215 | 219 |
| 216 // A GtkEntry that isn't part of the hierarchy. We keep this for native | 220 // A GtkEntry that isn't part of the hierarchy. We keep this for native |
| 217 // rendering. | 221 // rendering. |
| 218 ui::OwnedWidgetGtk offscreen_entry_; | 222 ui::OwnedWidgetGtk offscreen_entry_; |
| 219 | 223 |
| 220 // Manages the home button drop signal handler. | 224 // Manages the home button drop signal handler. |
| 221 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; | 225 scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; |
| 222 | 226 |
| 223 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); | 227 DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); |
| 224 }; | 228 }; |
| 225 | 229 |
| 226 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ | 230 #endif // CHROME_BROWSER_UI_GTK_BROWSER_TOOLBAR_GTK_H_ |
| OLD | NEW |