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

Side by Side Diff: chrome/views/message_box_view.h

Issue 8786: Fix default focused button in dialogs (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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 | Annotate | Revision Log
« no previous file with comments | « chrome/views/dialog_delegate.cc ('k') | chrome/views/message_box_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__ 5 #ifndef CHROME_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__
6 #define CHROME_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__ 6 #define CHROME_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // start, the message box has no checkbox until this function is called. 59 // start, the message box has no checkbox until this function is called.
60 void SetCheckBoxLabel(const std::wstring& label); 60 void SetCheckBoxLabel(const std::wstring& label);
61 61
62 protected: 62 protected:
63 // Layout and Painting functions. 63 // Layout and Painting functions.
64 virtual void ViewHierarchyChanged(bool is_add, 64 virtual void ViewHierarchyChanged(bool is_add,
65 views::View* parent, 65 views::View* parent,
66 views::View* child); 66 views::View* child);
67 67
68 private: 68 private:
69 // Called after ViewHierarchyChanged's call stack unwinds and returns to the
70 // message loop to focus the first focusable element in the dialog box.
71 void FocusFirstFocusableControl();
72
73 // Sets up the layout manager and initializes the prompt field. This should 69 // Sets up the layout manager and initializes the prompt field. This should
74 // only be called once, from the constructor. 70 // only be called once, from the constructor.
75 void Init(int dialog_flags, const std::wstring& default_prompt); 71 void Init(int dialog_flags, const std::wstring& default_prompt);
76 72
77 // Sets up the layout manager based on currently initialized views. Should be 73 // Sets up the layout manager based on currently initialized views. Should be
78 // called when a view is initialized or changed. 74 // called when a view is initialized or changed.
79 void ResetLayoutManager(); 75 void ResetLayoutManager();
80 76
81 // Message for the message box. 77 // Message for the message box.
82 views::Label* message_label_; 78 views::Label* message_label_;
(...skipping 10 matching lines...) Expand all
93 // Maximum width of the message label. 89 // Maximum width of the message label.
94 int message_width_; 90 int message_width_;
95 91
96 ScopedRunnableMethodFactory<MessageBoxView> focus_grabber_factory_; 92 ScopedRunnableMethodFactory<MessageBoxView> focus_grabber_factory_;
97 93
98 DISALLOW_EVIL_CONSTRUCTORS(MessageBoxView); 94 DISALLOW_EVIL_CONSTRUCTORS(MessageBoxView);
99 }; 95 };
100 96
101 #endif // CHROME_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__ 97 #endif // CHROME_VIEWS_MESSAGE_BOX_VIEW_VIEW_H__
102 98
OLDNEW
« no previous file with comments | « chrome/views/dialog_delegate.cc ('k') | chrome/views/message_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698