Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_INPUT_WINDOW_DIALOG_CONTROLLER_H_ | |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_INPUT_WINDOW_DIALOG_CONTROLLER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" | |
| 12 #include "chrome/browser/ui/input_window_dialog.h" | |
| 13 #include "ui/gfx/native_widget_types.h" | |
| 14 | |
| 15 class Profile; | |
| 16 | |
| 17 // BookmarkInputWindowDialogController manages the editing and/or creation of a | |
| 18 // bookmark page or a bookmark folder. If the user presses ok, the name change | |
| 19 // is committed to the model. | |
| 20 // | |
| 21 // BookmarkInputWindowDialogController deletes itself when the window is closed. | |
| 22 class BookmarkInputWindowDialogController : public InputWindowDialog::Delegate, | |
| 23 public BaseBookmarkModelObserver { | |
| 24 public: | |
| 25 enum Type { | |
|
flackr
2011/11/02 15:38:18
BookmarkEditor::EditDetails already encapsulates t
mazda
2011/11/07 09:59:23
Deleted this enum.
| |
| 26 NEW_BOOKMARK_PAGE, // Creates a new bookmark page. | |
| 27 NEW_BOOKMARK_FOLDER, // Creates a new bookmark folder. | |
| 28 EXISTING_BOOKMARK_PAGE, // Modifies an existing bookmark page. | |
| 29 EXISTING_BOOKMARK_FOLDER, // Renames an existing bookmark folder. | |
| 30 }; | |
| 31 | |
| 32 virtual ~BookmarkInputWindowDialogController(); | |
| 33 | |
| 34 static void Show(Profile* profile, | |
|
flackr
2011/11/02 15:38:18
Avoid exposing a public method which takes argumen
mazda
2011/11/07 09:59:23
I added index to BookmarkEditor::EditaDetails and
| |
| 35 gfx::NativeWindow wnd, | |
| 36 const BookmarkNode* node, | |
| 37 int index, | |
| 38 Type type); | |
| 39 | |
| 40 private: | |
| 41 BookmarkInputWindowDialogController(Profile* profile, | |
| 42 gfx::NativeWindow wnd, | |
| 43 const BookmarkNode* node, | |
| 44 int index, | |
| 45 Type type); | |
| 46 | |
| 47 // InputWindowDialog::Delegate: | |
| 48 virtual bool IsValid(const InputWindowDialog::InputTexts& texts) OVERRIDE; | |
| 49 virtual void InputAccepted( | |
| 50 const InputWindowDialog::InputTexts& texts) OVERRIDE; | |
| 51 virtual void InputCanceled() OVERRIDE; | |
| 52 | |
| 53 // BaseBookmarkModelObserver: | |
| 54 virtual void BookmarkModelChanged() OVERRIDE; | |
| 55 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE; | |
| 56 | |
| 57 Profile* profile_; | |
| 58 | |
| 59 BookmarkModel* model_; | |
| 60 | |
| 61 // If |is_new_| is true, this is the parent to create the new node under. | |
| 62 // Otherwise this is the node to change the title of. | |
| 63 const BookmarkNode* node_; | |
| 64 | |
| 65 // Index to insert the new folder at. | |
| 66 int index_; | |
| 67 | |
| 68 Type type_; | |
| 69 | |
| 70 InputWindowDialog* dialog_; | |
| 71 | |
| 72 DISALLOW_COPY_AND_ASSIGN(BookmarkInputWindowDialogController); | |
| 73 }; | |
| 74 | |
| 75 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_INPUT_WINDOW_DIALOG_CONTROLLER_H_ | |
| OLD | NEW |