OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/task.h" | 12 #include "base/task.h" |
13 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
14 #include "chrome/browser/extensions/extension_context_menu_model.h" | 14 #include "chrome/browser/extensions/extension_context_menu_model.h" |
15 #include "chrome/browser/first_run/first_run.h" | 15 #include "chrome/browser/first_run/first_run.h" |
16 #include "chrome/browser/search_engines/template_url_model_observer.h" | 16 #include "chrome/browser/search_engines/template_url_model_observer.h" |
17 #include "chrome/browser/ui/omnibox/location_bar.h" | 17 #include "chrome/browser/ui/omnibox/location_bar.h" |
18 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 18 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
19 #include "chrome/browser/views/extensions/extension_popup.h" | 19 #include "chrome/browser/views/extensions/extension_popup.h" |
20 #include "chrome/common/notification_observer.h" | 20 #include "chrome/common/notification_observer.h" |
21 #include "chrome/common/notification_registrar.h" | 21 #include "chrome/common/notification_registrar.h" |
22 #include "gfx/font.h" | 22 #include "gfx/font.h" |
23 #include "gfx/rect.h" | 23 #include "gfx/rect.h" |
24 #include "views/controls/native/native_view_host.h" | 24 #include "views/controls/native/native_view_host.h" |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" | 27 #include "chrome/browser/autocomplete/autocomplete_edit_view_win.h" |
28 #else | 28 #elif defined(OS_LINUX) |
29 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 29 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
30 #include "chrome/browser/gtk/accessible_widget_helper_gtk.h" | |
31 #endif | 30 #endif |
32 | 31 |
33 class CommandUpdater; | 32 class CommandUpdater; |
34 class ContentSettingImageView; | 33 class ContentSettingImageView; |
35 class EVBubbleView; | 34 class EVBubbleView; |
36 class ExtensionAction; | 35 class ExtensionAction; |
37 class GURL; | 36 class GURL; |
38 class InstantController; | 37 class InstantController; |
39 class KeywordHintView; | 38 class KeywordHintView; |
40 class LocationIconView; | 39 class LocationIconView; |
41 class PageActionWithBadgeView; | 40 class PageActionWithBadgeView; |
42 class Profile; | 41 class Profile; |
43 class SelectedKeywordView; | 42 class SelectedKeywordView; |
44 class StarView; | 43 class StarView; |
45 class TabContents; | 44 class TabContents; |
46 class TabContentsWrapper; | 45 class TabContentsWrapper; |
47 class TemplateURLModel; | 46 class TemplateURLModel; |
48 | 47 |
48 #if defined(OS_WIN) | |
Peter Kasting
2011/01/06 02:06:48
Nit: Leave this section where it was (Chrome conve
oshima
2011/01/06 19:43:35
Done.
| |
49 class SuggestedTextView; | |
50 #endif | |
51 | |
49 namespace views { | 52 namespace views { |
50 class HorizontalPainter; | 53 class HorizontalPainter; |
51 class Label; | 54 class Label; |
52 }; | 55 }; |
53 | 56 |
54 #if defined(OS_WIN) | |
55 class SuggestedTextView; | |
56 #endif | |
57 | |
58 ///////////////////////////////////////////////////////////////////////////// | 57 ///////////////////////////////////////////////////////////////////////////// |
59 // | 58 // |
60 // LocationBarView class | 59 // LocationBarView class |
61 // | 60 // |
62 // The LocationBarView class is a View subclass that paints the background | 61 // The LocationBarView class is a View subclass that paints the background |
63 // of the URL bar strip and contains its content. | 62 // of the URL bar strip and contains its content. |
64 // | 63 // |
65 ///////////////////////////////////////////////////////////////////////////// | 64 ///////////////////////////////////////////////////////////////////////////// |
66 class LocationBarView : public LocationBar, | 65 class LocationBarView : public LocationBar, |
67 public LocationBarTesting, | 66 public LocationBarTesting, |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 // Update the views for the Page Actions, to reflect state changes for | 307 // Update the views for the Page Actions, to reflect state changes for |
309 // PageActions. | 308 // PageActions. |
310 void RefreshPageActionViews(); | 309 void RefreshPageActionViews(); |
311 | 310 |
312 // Sets the visibility of view to new_vis. | 311 // Sets the visibility of view to new_vis. |
313 void ToggleVisibility(bool new_vis, views::View* view); | 312 void ToggleVisibility(bool new_vis, views::View* view); |
314 | 313 |
315 #if defined(OS_WIN) | 314 #if defined(OS_WIN) |
316 // Helper for the Mouse event handlers that does all the real work. | 315 // Helper for the Mouse event handlers that does all the real work. |
317 void OnMouseEvent(const views::MouseEvent& event, UINT msg); | 316 void OnMouseEvent(const views::MouseEvent& event, UINT msg); |
317 #endif | |
318 | 318 |
319 // Returns true if the suggest text is valid. | 319 // Returns true if the suggest text is valid. |
320 bool HasValidSuggestText(); | 320 bool HasValidSuggestText(); |
321 #endif | |
322 | 321 |
323 // Helper to show the first run info bubble. | 322 // Helper to show the first run info bubble. |
324 void ShowFirstRunBubbleInternal(FirstRun::BubbleType bubble_type); | 323 void ShowFirstRunBubbleInternal(FirstRun::BubbleType bubble_type); |
325 | 324 |
326 // Current profile. Not owned by us. | 325 // Current profile. Not owned by us. |
327 Profile* profile_; | 326 Profile* profile_; |
328 | 327 |
329 // The Autocomplete Edit field. | 328 // The Autocomplete Edit field. |
330 #if defined(OS_WIN) | 329 #if defined(OS_WIN) |
331 scoped_ptr<AutocompleteEditViewWin> location_entry_; | 330 scoped_ptr<AutocompleteEditViewWin> location_entry_; |
332 #else | 331 #else |
333 scoped_ptr<AutocompleteEditViewGtk> location_entry_; | 332 scoped_ptr<AutocompleteEditView> location_entry_; |
334 #endif | 333 #endif |
335 | 334 |
336 // The CommandUpdater for the Browser object that corresponds to this View. | 335 // The CommandUpdater for the Browser object that corresponds to this View. |
337 CommandUpdater* command_updater_; | 336 CommandUpdater* command_updater_; |
338 | 337 |
339 // The model. | 338 // The model. |
340 ToolbarModel* model_; | 339 ToolbarModel* model_; |
341 | 340 |
342 // Our delegate. | 341 // Our delegate. |
343 Delegate* delegate_; | 342 Delegate* delegate_; |
(...skipping 13 matching lines...) Expand all Loading... | |
357 | 356 |
358 // An object used to paint the normal-mode background. | 357 // An object used to paint the normal-mode background. |
359 scoped_ptr<views::HorizontalPainter> painter_; | 358 scoped_ptr<views::HorizontalPainter> painter_; |
360 | 359 |
361 // An icon to the left of the edit field. | 360 // An icon to the left of the edit field. |
362 LocationIconView* location_icon_view_; | 361 LocationIconView* location_icon_view_; |
363 | 362 |
364 // A bubble displayed for EV HTTPS sites. | 363 // A bubble displayed for EV HTTPS sites. |
365 EVBubbleView* ev_bubble_view_; | 364 EVBubbleView* ev_bubble_view_; |
366 | 365 |
367 // Location_entry view wrapper | 366 // Location_entry view |
368 views::NativeViewHost* location_entry_view_; | 367 views::View* location_entry_view_; |
369 | 368 |
370 // The following views are used to provide hints and remind the user as to | 369 // The following views are used to provide hints and remind the user as to |
371 // what is going in the edit. They are all added a children of the | 370 // what is going in the edit. They are all added a children of the |
372 // LocationBarView. At most one is visible at a time. Preference is | 371 // LocationBarView. At most one is visible at a time. Preference is |
373 // given to the keyword_view_, then hint_view_. | 372 // given to the keyword_view_, then hint_view_. |
374 // These autocollapse when the edit needs the room. | 373 // These autocollapse when the edit needs the room. |
375 | 374 |
376 // Shown if the user has selected a keyword. | 375 // Shown if the user has selected a keyword. |
377 SelectedKeywordView* selected_keyword_view_; | 376 SelectedKeywordView* selected_keyword_view_; |
378 | 377 |
(...skipping 23 matching lines...) Expand all Loading... | |
402 bool show_focus_rect_; | 401 bool show_focus_rect_; |
403 | 402 |
404 // Whether bubble text is short or long. | 403 // Whether bubble text is short or long. |
405 FirstRun::BubbleType bubble_type_; | 404 FirstRun::BubbleType bubble_type_; |
406 | 405 |
407 // This is in case we're destroyed before the model loads. We store the model | 406 // This is in case we're destroyed before the model loads. We store the model |
408 // because calling profile_->GetTemplateURLModel() in the destructor causes a | 407 // because calling profile_->GetTemplateURLModel() in the destructor causes a |
409 // crash. | 408 // crash. |
410 TemplateURLModel* template_url_model_; | 409 TemplateURLModel* template_url_model_; |
411 | 410 |
412 #if defined(OS_LINUX) | |
413 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; | |
414 #endif | |
415 | |
416 // Should instant be updated? This is set to false in OnAutocompleteWillAccept | 411 // Should instant be updated? This is set to false in OnAutocompleteWillAccept |
417 // and true in OnAutocompleteAccept. This is needed as prior to accepting an | 412 // and true in OnAutocompleteAccept. This is needed as prior to accepting an |
418 // autocomplete suggestion the model is reverted which triggers resetting | 413 // autocomplete suggestion the model is reverted which triggers resetting |
419 // instant. | 414 // instant. |
420 bool update_instant_; | 415 bool update_instant_; |
421 | 416 |
422 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); | 417 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); |
423 }; | 418 }; |
424 | 419 |
425 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 420 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |