OLD | NEW |
1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.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 "chrome/browser/autocomplete/autocomplete_edit.h" | 19 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
20 #include "chrome/browser/extensions/extension_context_menu_model.h" | 20 #include "chrome/browser/extensions/extension_context_menu_model.h" |
21 #include "chrome/browser/extensions/image_loading_tracker.h" | 21 #include "chrome/browser/extensions/image_loading_tracker.h" |
22 #include "chrome/browser/first_run/first_run.h" | |
23 #include "chrome/browser/prefs/pref_member.h" | 22 #include "chrome/browser/prefs/pref_member.h" |
24 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 23 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
25 #include "chrome/browser/ui/gtk/menu_gtk.h" | 24 #include "chrome/browser/ui/gtk/menu_gtk.h" |
26 #include "chrome/browser/ui/omnibox/location_bar.h" | 25 #include "chrome/browser/ui/omnibox/location_bar.h" |
27 #include "chrome/common/content_settings_types.h" | 26 #include "chrome/common/content_settings_types.h" |
28 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
29 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
30 #include "content/public/common/page_transition_types.h" | 29 #include "content/public/common/page_transition_types.h" |
31 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
32 #include "ui/base/animation/animation_delegate.h" | 31 #include "ui/base/animation/animation_delegate.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual void OnSelectionBoundsChanged() OVERRIDE; | 104 virtual void OnSelectionBoundsChanged() OVERRIDE; |
106 virtual void OnKillFocus() OVERRIDE; | 105 virtual void OnKillFocus() OVERRIDE; |
107 virtual void OnSetFocus() OVERRIDE; | 106 virtual void OnSetFocus() OVERRIDE; |
108 virtual void OnInputInProgress(bool in_progress) OVERRIDE; | 107 virtual void OnInputInProgress(bool in_progress) OVERRIDE; |
109 virtual SkBitmap GetFavicon() const OVERRIDE; | 108 virtual SkBitmap GetFavicon() const OVERRIDE; |
110 virtual string16 GetTitle() const OVERRIDE; | 109 virtual string16 GetTitle() const OVERRIDE; |
111 virtual InstantController* GetInstant() OVERRIDE; | 110 virtual InstantController* GetInstant() OVERRIDE; |
112 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE; | 111 virtual TabContentsWrapper* GetTabContentsWrapper() const OVERRIDE; |
113 | 112 |
114 // Implement the LocationBar interface. | 113 // Implement the LocationBar interface. |
115 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) OVERRIDE; | 114 virtual void ShowFirstRunBubble() OVERRIDE; |
116 virtual void SetSuggestedText(const string16& text, | 115 virtual void SetSuggestedText(const string16& text, |
117 InstantCompleteBehavior behavior) OVERRIDE; | 116 InstantCompleteBehavior behavior) OVERRIDE; |
118 virtual string16 GetInputString() const OVERRIDE; | 117 virtual string16 GetInputString() const OVERRIDE; |
119 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 118 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; |
120 virtual content::PageTransition GetPageTransition() const OVERRIDE; | 119 virtual content::PageTransition GetPageTransition() const OVERRIDE; |
121 virtual void AcceptInput() OVERRIDE; | 120 virtual void AcceptInput() OVERRIDE; |
122 virtual void FocusLocation(bool select_all) OVERRIDE; | 121 virtual void FocusLocation(bool select_all) OVERRIDE; |
123 virtual void FocusSearch() OVERRIDE; | 122 virtual void FocusSearch() OVERRIDE; |
124 virtual void UpdateContentSettingsIcons() OVERRIDE; | 123 virtual void UpdateContentSettingsIcons() OVERRIDE; |
125 virtual void UpdatePageActions() OVERRIDE; | 124 virtual void UpdatePageActions() OVERRIDE; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // tooltip text. Call with an empty string if the info label should be | 328 // tooltip text. Call with an empty string if the info label should be |
330 // hidden. | 329 // hidden. |
331 void SetInfoText(); | 330 void SetInfoText(); |
332 | 331 |
333 // Set the keyword text for the Search BLAH: keyword box. | 332 // Set the keyword text for the Search BLAH: keyword box. |
334 void SetKeywordLabel(const string16& keyword); | 333 void SetKeywordLabel(const string16& keyword); |
335 | 334 |
336 // Set the keyword text for the "Press tab to search BLAH" hint box. | 335 // Set the keyword text for the "Press tab to search BLAH" hint box. |
337 void SetKeywordHintLabel(const string16& keyword); | 336 void SetKeywordHintLabel(const string16& keyword); |
338 | 337 |
339 void ShowFirstRunBubbleInternal(FirstRun::BubbleType bubble_type); | 338 void ShowFirstRunBubbleInternal(); |
340 | 339 |
341 // Show or hide |tab_to_search_box_| and |tab_to_search_hint_| according to | 340 // Show or hide |tab_to_search_box_| and |tab_to_search_hint_| according to |
342 // the value of |show_selected_keyword_|, |show_keyword_hint_|, and the | 341 // the value of |show_selected_keyword_|, |show_keyword_hint_|, and the |
343 // available horizontal space in the location bar. | 342 // available horizontal space in the location bar. |
344 void AdjustChildrenVisibility(); | 343 void AdjustChildrenVisibility(); |
345 | 344 |
346 // Build the star icon. | 345 // Build the star icon. |
347 void CreateStarButton(); | 346 void CreateStarButton(); |
348 | 347 |
349 // Update the star icon after it is toggled or the theme changes. | 348 // Update the star icon after it is toggled or the theme changes. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // the LocationBar interface via GetInputString(). | 408 // the LocationBar interface via GetInputString(). |
410 string16 location_input_; | 409 string16 location_input_; |
411 | 410 |
412 // The user's desired disposition for how their input should be opened. | 411 // The user's desired disposition for how their input should be opened. |
413 WindowOpenDisposition disposition_; | 412 WindowOpenDisposition disposition_; |
414 | 413 |
415 // The transition type to use for the navigation. | 414 // The transition type to use for the navigation. |
416 content::PageTransition transition_; | 415 content::PageTransition transition_; |
417 | 416 |
418 // Used to schedule a task for the first run bubble. | 417 // Used to schedule a task for the first run bubble. |
419 base::WeakPtrFactory<LocationBarViewGtk> first_run_bubble_; | 418 base::WeakPtrFactory<LocationBarViewGtk> weak_ptr_factory_; |
420 | 419 |
421 // When true, the location bar view is read only and also is has a slightly | 420 // When true, the location bar view is read only and also is has a slightly |
422 // different presentation (font size / color). This is used for popups. | 421 // different presentation (font size / color). This is used for popups. |
423 bool popup_window_mode_; | 422 bool popup_window_mode_; |
424 | 423 |
425 // Provides colors and rendering mode. | 424 // Provides colors and rendering mode. |
426 GtkThemeService* theme_service_; | 425 GtkThemeService* theme_service_; |
427 | 426 |
428 content::NotificationRegistrar registrar_; | 427 content::NotificationRegistrar registrar_; |
429 | 428 |
(...skipping 13 matching lines...) Expand all Loading... |
443 // The last search keyword that was shown via the |tab_to_search_box_|. | 442 // The last search keyword that was shown via the |tab_to_search_box_|. |
444 string16 last_keyword_; | 443 string16 last_keyword_; |
445 | 444 |
446 // Used to change the visibility of the star decoration. | 445 // Used to change the visibility of the star decoration. |
447 BooleanPrefMember edit_bookmarks_enabled_; | 446 BooleanPrefMember edit_bookmarks_enabled_; |
448 | 447 |
449 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 448 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
450 }; | 449 }; |
451 | 450 |
452 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 451 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |