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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_dialog.cc

Issue 8497008: Implement Bookmark All Tabs Dialog with WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/ui/views/extensions/extension_dialog.h" 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h"
6 6
7 #include "chrome/browser/extensions/extension_host.h" 7 #include "chrome/browser/extensions/extension_host.h"
8 #include "chrome/browser/extensions/extension_process_manager.h" 8 #include "chrome/browser/extensions/extension_process_manager.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ExtensionDialog::~ExtensionDialog() { 56 ExtensionDialog::~ExtensionDialog() {
57 } 57 }
58 58
59 // static 59 // static
60 ExtensionDialog* ExtensionDialog::Show( 60 ExtensionDialog* ExtensionDialog::Show(
61 const GURL& url, 61 const GURL& url,
62 Browser* browser, 62 Browser* browser,
63 TabContents* tab_contents, 63 TabContents* tab_contents,
64 int width, 64 int width,
65 int height, 65 int height,
66 const string16& title,
66 ExtensionDialogObserver* observer) { 67 ExtensionDialogObserver* observer) {
67 CHECK(browser); 68 CHECK(browser);
68 ExtensionHost* host = CreateExtensionHost(url, browser); 69 ExtensionHost* host = CreateExtensionHost(url, browser);
69 if (!host) 70 if (!host)
70 return NULL; 71 return NULL;
71 host->set_associated_tab_contents(tab_contents); 72 host->set_associated_tab_contents(tab_contents);
72 73
73 ExtensionDialog* dialog = new ExtensionDialog(host, observer); 74 ExtensionDialog* dialog = new ExtensionDialog(host, observer);
75 dialog->set_title(title);
74 dialog->InitWindow(browser, width, height); 76 dialog->InitWindow(browser, width, height);
75 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts. 77 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts.
76 host->render_view_host()->view()->Focus(); 78 host->render_view_host()->view()->Focus();
77 return dialog; 79 return dialog;
78 } 80 }
79 81
80 // static 82 // static
81 ExtensionHost* ExtensionDialog::CreateExtensionHost(const GURL& url, 83 ExtensionHost* ExtensionDialog::CreateExtensionHost(const GURL& url,
82 Browser* browser) { 84 Browser* browser) {
83 ExtensionProcessManager* manager = 85 ExtensionProcessManager* manager =
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 124
123 bool ExtensionDialog::CanResize() const { 125 bool ExtensionDialog::CanResize() const {
124 return false; 126 return false;
125 } 127 }
126 128
127 bool ExtensionDialog::IsModal() const { 129 bool ExtensionDialog::IsModal() const {
128 return true; 130 return true;
129 } 131 }
130 132
131 bool ExtensionDialog::ShouldShowWindowTitle() const { 133 bool ExtensionDialog::ShouldShowWindowTitle() const {
132 return false; 134 return !window_title_.empty();
135 }
136
137 string16 ExtensionDialog::GetWindowTitle() const {
138 return window_title_;
133 } 139 }
134 140
135 void ExtensionDialog::DeleteDelegate() { 141 void ExtensionDialog::DeleteDelegate() {
136 // The window has finished closing. Allow ourself to be deleted. 142 // The window has finished closing. Allow ourself to be deleted.
137 Release(); 143 Release();
138 } 144 }
139 145
140 views::Widget* ExtensionDialog::GetWidget() { 146 views::Widget* ExtensionDialog::GetWidget() {
141 return extension_host_->view()->GetWidget(); 147 return extension_host_->view()->GetWidget();
142 } 148 }
(...skipping 17 matching lines...) Expand all
160 // If we aren't the host of the popup, then disregard the notification. 166 // If we aren't the host of the popup, then disregard the notification.
161 if (content::Details<ExtensionHost>(host()) != details) 167 if (content::Details<ExtensionHost>(host()) != details)
162 return; 168 return;
163 Close(); 169 Close();
164 break; 170 break;
165 default: 171 default:
166 NOTREACHED() << L"Received unexpected notification"; 172 NOTREACHED() << L"Received unexpected notification";
167 break; 173 break;
168 } 174 }
169 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_dialog.h ('k') | chrome/browser/ui/views/select_file_dialog_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698