| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_LOCATION_BAR_VIEW_H__ | 5 #ifndef CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ | 6 #define CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Overridden from LocationBar: | 114 // Overridden from LocationBar: |
| 115 virtual void ShowFirstRunBubble(); | 115 virtual void ShowFirstRunBubble(); |
| 116 virtual std::wstring GetInputString() const; | 116 virtual std::wstring GetInputString() const; |
| 117 virtual WindowOpenDisposition GetWindowOpenDisposition() const; | 117 virtual WindowOpenDisposition GetWindowOpenDisposition() const; |
| 118 virtual PageTransition::Type GetPageTransition() const; | 118 virtual PageTransition::Type GetPageTransition() const; |
| 119 virtual void AcceptInput(); | 119 virtual void AcceptInput(); |
| 120 virtual void FocusLocation(); | 120 virtual void FocusLocation(); |
| 121 virtual void FocusSearch(); | 121 virtual void FocusSearch(); |
| 122 virtual void SaveStateToContents(TabContents* contents); | 122 virtual void SaveStateToContents(TabContents* contents); |
| 123 | 123 |
| 124 static const int kTextVertMargin; | 124 static const int kVertMargin; |
| 125 static const COLORREF kBackgroundColorByLevel[]; | 125 static const COLORREF kBackgroundColorByLevel[]; |
| 126 | 126 |
| 127 protected: | 127 protected: |
| 128 void Focus(); | 128 void Focus(); |
| 129 | 129 |
| 130 // Overridden from Chrome::View. | 130 // Overridden from Chrome::View. |
| 131 virtual bool ShouldLookupAccelerators(const views::KeyEvent& e); | 131 virtual bool ShouldLookupAccelerators(const views::KeyEvent& e); |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 // View used when the user has selected a keyword. | 134 // View used when the user has selected a keyword. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 DISALLOW_EVIL_CONSTRUCTORS(SecurityImageView); | 277 DISALLOW_EVIL_CONSTRUCTORS(SecurityImageView); |
| 278 }; | 278 }; |
| 279 | 279 |
| 280 // Both Layout and OnChanged call into this. This updates the contents | 280 // Both Layout and OnChanged call into this. This updates the contents |
| 281 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If | 281 // of the 3 views: selected_keyword, keyword_hint and type_search_view. If |
| 282 // force_layout is true, or one of these views has changed in such a way as | 282 // force_layout is true, or one of these views has changed in such a way as |
| 283 // to necessitate a layout, layout occurs as well. | 283 // to necessitate a layout, layout occurs as well. |
| 284 void DoLayout(bool force_layout); | 284 void DoLayout(bool force_layout); |
| 285 | 285 |
| 286 // Returns the number of pixels to clip off the top edge of the background |
| 287 // graphics. With the Vista frame, the DWM draws a dark border around the |
| 288 // content, so we clip the single dark pixel on the popup background image, |
| 289 // which otherwise looks redundant. |
| 290 int TopOffset() const; |
| 291 |
| 292 // Returns the height in pixels of the margin at the top of the bar, after |
| 293 // TopOffset() pixels have been clipped off. |
| 294 int TopMargin() const; |
| 295 |
| 286 // Returns the width in pixels of the contents of the edit. | 296 // Returns the width in pixels of the contents of the edit. |
| 287 int TextDisplayWidth(); | 297 int TextDisplayWidth(); |
| 288 | 298 |
| 289 // Returns true if the preferred size should be used for a view whose width | 299 // Returns true if the preferred size should be used for a view whose width |
| 290 // is pref_width, the width of the text in the edit is text_width, and | 300 // is pref_width, the width of the text in the edit is text_width, and |
| 291 // max_width is the maximum width of the edit. If this returns false, the | 301 // max_width is the maximum width of the edit. If this returns false, the |
| 292 // minimum size of the view should be used. | 302 // minimum size of the view should be used. |
| 293 bool UsePref(int pref_width, int text_width, int max_width); | 303 bool UsePref(int pref_width, int text_width, int max_width); |
| 294 | 304 |
| 295 // Returns true if the view needs to be resized. This determines whether the | 305 // Returns true if the view needs to be resized. This determines whether the |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // When true, the location bar view is read only and also is has a slightly | 392 // When true, the location bar view is read only and also is has a slightly |
| 383 // different presentation (font size / color). This is used for popups. | 393 // different presentation (font size / color). This is used for popups. |
| 384 bool popup_window_mode_; | 394 bool popup_window_mode_; |
| 385 | 395 |
| 386 // Used schedule a task for the first run info bubble. | 396 // Used schedule a task for the first run info bubble. |
| 387 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; | 397 ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; |
| 388 }; | 398 }; |
| 389 | 399 |
| 390 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ | 400 #endif // CHROME_BROWSER_VIEWS_LOCATION_BAR_VIEW_H__ |
| 391 | 401 |
| OLD | NEW |