Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.h

Issue 678093002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_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 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 DEEMPHASIZED_TEXT, 131 DEEMPHASIZED_TEXT,
132 SECURITY_TEXT, 132 SECURITY_TEXT,
133 }; 133 };
134 134
135 LocationBarView(Browser* browser, 135 LocationBarView(Browser* browser,
136 Profile* profile, 136 Profile* profile,
137 CommandUpdater* command_updater, 137 CommandUpdater* command_updater,
138 Delegate* delegate, 138 Delegate* delegate,
139 bool is_popup_mode); 139 bool is_popup_mode);
140 140
141 virtual ~LocationBarView(); 141 ~LocationBarView() override;
142 142
143 // Initializes the LocationBarView. 143 // Initializes the LocationBarView.
144 void Init(); 144 void Init();
145 145
146 // True if this instance has been initialized by calling Init, which can only 146 // True if this instance has been initialized by calling Init, which can only
147 // be called when the receiving instance is attached to a view container. 147 // be called when the receiving instance is attached to a view container.
148 bool IsInitialized() const; 148 bool IsInitialized() const;
149 149
150 // Returns the appropriate color for the desired kind, based on the user's 150 // Returns the appropriate color for the desired kind, based on the user's
151 // system theme. 151 // system theme.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 // Returns the position and width that the popup should be, and also the left 233 // Returns the position and width that the popup should be, and also the left
234 // edge that the results should align themselves to (which will leave some 234 // edge that the results should align themselves to (which will leave some
235 // border on the left of the popup). 235 // border on the left of the popup).
236 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, 236 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord,
237 int* popup_width, 237 int* popup_width,
238 int* left_margin, 238 int* left_margin,
239 int* right_margin); 239 int* right_margin);
240 240
241 // LocationBar: 241 // LocationBar:
242 virtual void FocusLocation(bool select_all) override; 242 void FocusLocation(bool select_all) override;
243 virtual void Revert() override; 243 void Revert() override;
244 virtual OmniboxView* GetOmniboxView() override; 244 OmniboxView* GetOmniboxView() override;
245 245
246 // views::View: 246 // views::View:
247 virtual bool HasFocus() const override; 247 bool HasFocus() const override;
248 virtual void GetAccessibleState(ui::AXViewState* state) override; 248 void GetAccessibleState(ui::AXViewState* state) override;
249 virtual gfx::Size GetPreferredSize() const override; 249 gfx::Size GetPreferredSize() const override;
250 virtual void Layout() override; 250 void Layout() override;
251 251
252 // OmniboxEditController: 252 // OmniboxEditController:
253 virtual void Update(const content::WebContents* contents) override; 253 void Update(const content::WebContents* contents) override;
254 virtual void ShowURL() override; 254 void ShowURL() override;
255 virtual void EndOriginChipAnimations(bool cancel_fade) override; 255 void EndOriginChipAnimations(bool cancel_fade) override;
256 virtual ToolbarModel* GetToolbarModel() override; 256 ToolbarModel* GetToolbarModel() override;
257 virtual content::WebContents* GetWebContents() override; 257 content::WebContents* GetWebContents() override;
258 258
259 // Thickness of the edges of the omnibox background images, in normal mode. 259 // Thickness of the edges of the omnibox background images, in normal mode.
260 static const int kNormalEdgeThickness; 260 static const int kNormalEdgeThickness;
261 // The same, but for popup mode. 261 // The same, but for popup mode.
262 static const int kPopupEdgeThickness; 262 static const int kPopupEdgeThickness;
263 // Space between items in the location bar, as well as between items and the 263 // Space between items in the location bar, as well as between items and the
264 // edges. 264 // edges.
265 static const int kItemPadding; 265 static const int kItemPadding;
266 // Amount of padding built into the standard omnibox icons. 266 // Amount of padding built into the standard omnibox icons.
267 static const int kIconInternalPadding; 267 static const int kIconInternalPadding;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // if it's false) should be set to in order to produce the same omnibox 332 // if it's false) should be set to in order to produce the same omnibox
333 // position. This way we can stop the old animation, set the new animation to 333 // position. This way we can stop the old animation, set the new animation to
334 // this value, and start it running, and the text will appear to reverse 334 // this value, and start it running, and the text will appear to reverse
335 // directions from its current location. 335 // directions from its current location.
336 double GetValueForAnimation(bool hide) const; 336 double GetValueForAnimation(bool hide) const;
337 337
338 // Resets |show_url_animation_| and the color changes it causes. 338 // Resets |show_url_animation_| and the color changes it causes.
339 void ResetShowAnimationAndColors(); 339 void ResetShowAnimationAndColors();
340 340
341 // LocationBar: 341 // LocationBar:
342 virtual void ShowFirstRunBubble() override; 342 void ShowFirstRunBubble() override;
343 virtual GURL GetDestinationURL() const override; 343 GURL GetDestinationURL() const override;
344 virtual WindowOpenDisposition GetWindowOpenDisposition() const override; 344 WindowOpenDisposition GetWindowOpenDisposition() const override;
345 virtual ui::PageTransition GetPageTransition() const override; 345 ui::PageTransition GetPageTransition() const override;
346 virtual void AcceptInput() override; 346 void AcceptInput() override;
347 virtual void FocusSearch() override; 347 void FocusSearch() override;
348 virtual void UpdateContentSettingsIcons() override; 348 void UpdateContentSettingsIcons() override;
349 virtual void UpdateManagePasswordsIconAndBubble() override; 349 void UpdateManagePasswordsIconAndBubble() override;
350 virtual void UpdatePageActions() override; 350 void UpdatePageActions() override;
351 virtual void InvalidatePageActions() override; 351 void InvalidatePageActions() override;
352 virtual void UpdateBookmarkStarVisibility() override; 352 void UpdateBookmarkStarVisibility() override;
353 virtual bool ShowPageActionPopup(const extensions::Extension* extension, 353 bool ShowPageActionPopup(const extensions::Extension* extension,
354 bool grant_active_tab) override; 354 bool grant_active_tab) override;
355 virtual void UpdateOpenPDFInReaderPrompt() override; 355 void UpdateOpenPDFInReaderPrompt() override;
356 virtual void UpdateGeneratedCreditCardView() override; 356 void UpdateGeneratedCreditCardView() override;
357 virtual void SaveStateToContents(content::WebContents* contents) override; 357 void SaveStateToContents(content::WebContents* contents) override;
358 virtual const OmniboxView* GetOmniboxView() const override; 358 const OmniboxView* GetOmniboxView() const override;
359 virtual LocationBarTesting* GetLocationBarForTesting() override; 359 LocationBarTesting* GetLocationBarForTesting() override;
360 360
361 // LocationBarTesting: 361 // LocationBarTesting:
362 virtual int PageActionCount() override; 362 int PageActionCount() override;
363 virtual int PageActionVisibleCount() override; 363 int PageActionVisibleCount() override;
364 virtual ExtensionAction* GetPageAction(size_t index) override; 364 ExtensionAction* GetPageAction(size_t index) override;
365 virtual ExtensionAction* GetVisiblePageAction(size_t index) override; 365 ExtensionAction* GetVisiblePageAction(size_t index) override;
366 virtual void TestPageActionPressed(size_t index) override; 366 void TestPageActionPressed(size_t index) override;
367 virtual bool GetBookmarkStarVisibility() override; 367 bool GetBookmarkStarVisibility() override;
368 368
369 // views::View: 369 // views::View:
370 virtual const char* GetClassName() const override; 370 const char* GetClassName() const override;
371 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) override; 371 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
372 virtual void OnFocus() override; 372 void OnFocus() override;
373 virtual void OnPaint(gfx::Canvas* canvas) override; 373 void OnPaint(gfx::Canvas* canvas) override;
374 virtual void PaintChildren(gfx::Canvas* canvas, 374 void PaintChildren(gfx::Canvas* canvas,
375 const views::CullSet& cull_set) override; 375 const views::CullSet& cull_set) override;
376 376
377 // views::ButtonListener: 377 // views::ButtonListener:
378 virtual void ButtonPressed(views::Button* sender, 378 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
379 const ui::Event& event) override;
380 379
381 // views::DragController: 380 // views::DragController:
382 virtual void WriteDragDataForView(View* sender, 381 void WriteDragDataForView(View* sender,
383 const gfx::Point& press_pt, 382 const gfx::Point& press_pt,
384 OSExchangeData* data) override; 383 OSExchangeData* data) override;
385 virtual int GetDragOperationsForView(View* sender, 384 int GetDragOperationsForView(View* sender, const gfx::Point& p) override;
386 const gfx::Point& p) override; 385 bool CanStartDragForView(View* sender,
387 virtual bool CanStartDragForView(View* sender, 386 const gfx::Point& press_pt,
388 const gfx::Point& press_pt, 387 const gfx::Point& p) override;
389 const gfx::Point& p) override;
390 388
391 // OmniboxEditController: 389 // OmniboxEditController:
392 virtual void OnChanged() override; 390 void OnChanged() override;
393 virtual void OnSetFocus() override; 391 void OnSetFocus() override;
394 virtual InstantController* GetInstant() override; 392 InstantController* GetInstant() override;
395 virtual const ToolbarModel* GetToolbarModel() const override; 393 const ToolbarModel* GetToolbarModel() const override;
396 virtual void HideURL() override; 394 void HideURL() override;
397 395
398 // DropdownBarHostDelegate: 396 // DropdownBarHostDelegate:
399 virtual void SetFocusAndSelection(bool select_all) override; 397 void SetFocusAndSelection(bool select_all) override;
400 virtual void SetAnimationOffset(int offset) override; 398 void SetAnimationOffset(int offset) override;
401 399
402 // gfx::AnimationDelegate: 400 // gfx::AnimationDelegate:
403 virtual void AnimationProgressed(const gfx::Animation* animation) override; 401 void AnimationProgressed(const gfx::Animation* animation) override;
404 virtual void AnimationEnded(const gfx::Animation* animation) override; 402 void AnimationEnded(const gfx::Animation* animation) override;
405 403
406 // TemplateURLServiceObserver: 404 // TemplateURLServiceObserver:
407 virtual void OnTemplateURLServiceChanged() override; 405 void OnTemplateURLServiceChanged() override;
408 406
409 // SearchModelObserver: 407 // SearchModelObserver:
410 virtual void ModelChanged(const SearchModel::State& old_state, 408 void ModelChanged(const SearchModel::State& old_state,
411 const SearchModel::State& new_state) override; 409 const SearchModel::State& new_state) override;
412 410
413 // The Browser this LocationBarView is in. Note that at least 411 // The Browser this LocationBarView is in. Note that at least
414 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser 412 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser
415 // window, so this may be NULL. 413 // window, so this may be NULL.
416 Browser* browser_; 414 Browser* browser_;
417 415
418 OmniboxViewViews* omnibox_view_; 416 OmniboxViewViews* omnibox_view_;
419 417
420 // Our delegate. 418 // Our delegate.
421 Delegate* delegate_; 419 Delegate* delegate_;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 // The width is always positive. The ending width is the width of the entire 543 // The width is always positive. The ending width is the width of the entire
546 // omnibox URL. As the show animation runs, the current width gradually moves 544 // omnibox URL. As the show animation runs, the current width gradually moves
547 // from the width of the hostname to the ending value. 545 // from the width of the hostname to the ending value.
548 int current_omnibox_width_; 546 int current_omnibox_width_;
549 int ending_omnibox_width_; 547 int ending_omnibox_width_;
550 548
551 DISALLOW_COPY_AND_ASSIGN(LocationBarView); 549 DISALLOW_COPY_AND_ASSIGN(LocationBarView);
552 }; 550 };
553 551
554 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 552 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698