| 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_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/prefs/public/pref_observer.h" |
| 19 #include "chrome/browser/api/prefs/pref_member.h" | 20 #include "chrome/browser/api/prefs/pref_member.h" |
| 20 #include "chrome/browser/extensions/extension_action.h" | 21 #include "chrome/browser/extensions/extension_action.h" |
| 21 #include "chrome/browser/extensions/extension_action_icon_factory.h" | 22 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
| 22 #include "chrome/browser/extensions/extension_context_menu_model.h" | 23 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 23 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 24 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 24 #include "chrome/browser/ui/gtk/menu_gtk.h" | 25 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 25 #include "chrome/browser/ui/omnibox/location_bar.h" | 26 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 26 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 27 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 27 #include "chrome/browser/ui/view_ids.h" | 28 #include "chrome/browser/ui/view_ids.h" |
| 28 #include "chrome/common/content_settings_types.h" | 29 #include "chrome/common/content_settings_types.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 54 class Image; | 55 class Image; |
| 55 } | 56 } |
| 56 | 57 |
| 57 namespace ui { | 58 namespace ui { |
| 58 class AcceleratorGtk; | 59 class AcceleratorGtk; |
| 59 } | 60 } |
| 60 | 61 |
| 61 class LocationBarViewGtk : public OmniboxEditController, | 62 class LocationBarViewGtk : public OmniboxEditController, |
| 62 public LocationBar, | 63 public LocationBar, |
| 63 public LocationBarTesting, | 64 public LocationBarTesting, |
| 64 public content::NotificationObserver { | 65 public content::NotificationObserver, |
| 66 public PrefObserver { |
| 65 public: | 67 public: |
| 66 explicit LocationBarViewGtk(Browser* browser); | 68 explicit LocationBarViewGtk(Browser* browser); |
| 67 virtual ~LocationBarViewGtk(); | 69 virtual ~LocationBarViewGtk(); |
| 68 | 70 |
| 69 void Init(bool popup_window_mode); | 71 void Init(bool popup_window_mode); |
| 70 | 72 |
| 71 // Returns the widget the caller should host. You must call Init() first. | 73 // Returns the widget the caller should host. You must call Init() first. |
| 72 GtkWidget* widget() { return hbox_.get(); } | 74 GtkWidget* widget() { return hbox_.get(); } |
| 73 | 75 |
| 74 // Returns the widget the page info bubble should point to. | 76 // Returns the widget the page info bubble should point to. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; | 160 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; |
| 159 virtual void TestPageActionPressed(size_t index) OVERRIDE; | 161 virtual void TestPageActionPressed(size_t index) OVERRIDE; |
| 160 virtual void TestActionBoxMenuItemSelected(int command_id) OVERRIDE; | 162 virtual void TestActionBoxMenuItemSelected(int command_id) OVERRIDE; |
| 161 virtual bool GetBookmarkStarVisibility() OVERRIDE; | 163 virtual bool GetBookmarkStarVisibility() OVERRIDE; |
| 162 | 164 |
| 163 // content::NotificationObserver: | 165 // content::NotificationObserver: |
| 164 virtual void Observe(int type, | 166 virtual void Observe(int type, |
| 165 const content::NotificationSource& source, | 167 const content::NotificationSource& source, |
| 166 const content::NotificationDetails& details) OVERRIDE; | 168 const content::NotificationDetails& details) OVERRIDE; |
| 167 | 169 |
| 170 // PrefObserver: |
| 171 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 172 const std::string& pref_name) OVERRIDE; |
| 173 |
| 168 // Edit background color. | 174 // Edit background color. |
| 169 static const GdkColor kBackgroundColor; | 175 static const GdkColor kBackgroundColor; |
| 170 | 176 |
| 171 // Superclass for content settings icons shown at the left side of the | 177 // Superclass for content settings icons shown at the left side of the |
| 172 // location bar. | 178 // location bar. |
| 173 class PageToolViewGtk : public ui::AnimationDelegate { | 179 class PageToolViewGtk : public ui::AnimationDelegate { |
| 174 public: | 180 public: |
| 175 explicit PageToolViewGtk(const LocationBarViewGtk* parent); | 181 explicit PageToolViewGtk(const LocationBarViewGtk* parent); |
| 176 virtual ~PageToolViewGtk(); | 182 virtual ~PageToolViewGtk(); |
| 177 | 183 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 BooleanPrefMember edit_bookmarks_enabled_; | 537 BooleanPrefMember edit_bookmarks_enabled_; |
| 532 | 538 |
| 533 // Used to remember the URL and title text when drag&drop has begun. | 539 // Used to remember the URL and title text when drag&drop has begun. |
| 534 GURL drag_url_; | 540 GURL drag_url_; |
| 535 string16 drag_title_; | 541 string16 drag_title_; |
| 536 | 542 |
| 537 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 543 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
| 538 }; | 544 }; |
| 539 | 545 |
| 540 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 546 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| OLD | NEW |