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

Side by Side Diff: chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.cc

Issue 10317014: Move Command class out of the Extension class and into its own location (under chrome/common/exten… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months 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) 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 #include "chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h" 5 #include "chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 gtk_label_set_markup(GTK_LABEL(heading_label), markup); 229 gtk_label_set_markup(GTK_LABEL(heading_label), markup);
230 g_free(markup); 230 g_free(markup);
231 231
232 gtk_util::SetLabelWidth(heading_label, kTextColumnWidth); 232 gtk_util::SetLabelWidth(heading_label, kTextColumnWidth);
233 gtk_box_pack_start(GTK_BOX(text_column), heading_label, FALSE, FALSE, 0); 233 gtk_box_pack_start(GTK_BOX(text_column), heading_label, FALSE, FALSE, 0);
234 234
235 bool has_keybinding = false; 235 bool has_keybinding = false;
236 236
237 // Browser action label. 237 // Browser action label.
238 if (type_ == BROWSER_ACTION) { 238 if (type_ == BROWSER_ACTION) {
239 const Extension::Command* browser_action_command = 239 const extensions::Command* browser_action_command =
240 extension_->browser_action_command(); 240 extension_->browser_action_command();
241 GtkWidget* info_label; 241 GtkWidget* info_label;
242 if (!browser_action_command) { 242 if (!browser_action_command) {
243 info_label = gtk_label_new(l10n_util::GetStringUTF8( 243 info_label = gtk_label_new(l10n_util::GetStringUTF8(
244 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO).c_str()); 244 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO).c_str());
245 } else { 245 } else {
246 info_label = gtk_label_new(l10n_util::GetStringFUTF8( 246 info_label = gtk_label_new(l10n_util::GetStringFUTF8(
247 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO_WITH_SHORTCUT, 247 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO_WITH_SHORTCUT,
248 browser_action_command->accelerator().GetShortcutText()).c_str()); 248 browser_action_command->accelerator().GetShortcutText()).c_str());
249 has_keybinding = true; 249 has_keybinding = true;
250 } 250 }
251 gtk_util::SetLabelWidth(info_label, kTextColumnWidth); 251 gtk_util::SetLabelWidth(info_label, kTextColumnWidth);
252 gtk_box_pack_start(GTK_BOX(text_column), info_label, FALSE, FALSE, 0); 252 gtk_box_pack_start(GTK_BOX(text_column), info_label, FALSE, FALSE, 0);
253 } 253 }
254 254
255 // Page action label. 255 // Page action label.
256 if (type_ == PAGE_ACTION) { 256 if (type_ == PAGE_ACTION) {
257 const Extension::Command* page_action_command = 257 const extensions::Command* page_action_command =
258 extension_->page_action_command(); 258 extension_->page_action_command();
259 GtkWidget* info_label; 259 GtkWidget* info_label;
260 if (!page_action_command) { 260 if (!page_action_command) {
261 info_label = gtk_label_new(l10n_util::GetStringUTF8( 261 info_label = gtk_label_new(l10n_util::GetStringUTF8(
262 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO).c_str()); 262 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO).c_str());
263 } else { 263 } else {
264 info_label = gtk_label_new(l10n_util::GetStringFUTF8( 264 info_label = gtk_label_new(l10n_util::GetStringFUTF8(
265 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO_WITH_SHORTCUT, 265 IDS_EXTENSION_INSTALLED_PAGE_ACTION_INFO_WITH_SHORTCUT,
266 page_action_command->accelerator().GetShortcutText()).c_str()); 266 page_action_command->accelerator().GetShortcutText()).c_str());
267 has_keybinding = true; 267 has_keybinding = true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // on all references being cleared before it is destroyed. 354 // on all references being cleared before it is destroyed.
355 MessageLoopForUI::current()->PostTask( 355 MessageLoopForUI::current()->PostTask(
356 FROM_HERE, 356 FROM_HERE,
357 base::Bind(&ExtensionInstalledBubbleGtk::Close, this)); 357 base::Bind(&ExtensionInstalledBubbleGtk::Close, this));
358 } 358 }
359 359
360 void ExtensionInstalledBubbleGtk::Close() { 360 void ExtensionInstalledBubbleGtk::Close() {
361 Release(); // Balanced in ctor. 361 Release(); // Balanced in ctor.
362 bubble_ = NULL; 362 bubble_ = NULL;
363 } 363 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698